0

在这里,当我传递正确和不正确的值时,我得到的结果都是 4

当我执行这个查询时

select Count(*) into result 
from document_details 
where document_name = name 
and document_path = path; 

然后它告诉我正确的答案是 1。请尽快帮助我。先感谢您!!

create procedure check_status(IN name INT(30),IN path INT(255))    
    BEGIN
    declare result int;
    set result = 0;
    select Count(*) into result from `document_details` where `document_name`=name and `document_path`=path;
    select result;

END
4

1 回答 1

0

IF 类型没问题,那么 id 不应该工作,然后更改为 ie(name CHAR(30),path CHAR(255))

create procedure check_status(name INT(30),path INT(255))    
BEGIN

select Count(*) as result from `document_details` 
where `document_name`=name and     `document_path`=path;

END;

在程序中没有IN/OUT在函数中有...

于 2013-08-14T08:53:28.737 回答