gpt4 book ai didi

mysql - mysql存储过程中的参数

转载 作者:行者123 更新时间:2023-11-30 01:23:53 26 4
gpt4 key购买 nike

在这里,当我传递正确和不正确的值时,我得到的结果都是 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

最佳答案

如果类型没问题,那么应该不起作用,然后更改为 (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,在函数中有...

关于mysql - mysql存储过程中的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18227038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com