mysql中存储过程中的参数

时间:2021-05-24 11:01:13

Here,when I am passing correct and incorrect value,both the times I am getting result as 4

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

When I am executing this query

当我执行此查询时

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

then it shows me correct answer which is 1. Kindly help me ASAP. Thank You in advance!!

然后它显示了我的正确答案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

1 个解决方案

#1


0  

IF types are OK, then that shoud work id not, change then into i.e. (name CHAR(30),path CHAR(255))

IF类型没问题,然后那个shoud work id没有,然后改成ie(名字CHAR(30),路径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 procedures there is no IN/OUT in funcions there are...

在程序中,没有IN / OUT功能有...

#1


0  

IF types are OK, then that shoud work id not, change then into i.e. (name CHAR(30),path CHAR(255))

IF类型没问题,然后那个shoud work id没有,然后改成ie(名字CHAR(30),路径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 procedures there is no IN/OUT in funcions there are...

在程序中,没有IN / OUT功能有...