存储过程,参数数量不正确bug?
16lz
2021-01-22
I have an issue that is driving me crazy right now. Yesterday I made a simple SP, it worked great then. Today, without any changes to the SP, it is not working at all. None of the SP works. I get the 1318 error code all the time. As I said, everything worked great yesterday.
我有一个让你疯狂的问题。昨天我制作了一个简单的SP,它的效果非常好。今天,如果不对SP进行任何更改,它根本不起作用。没有SP工作。我一直得到1318错误代码。正如我所说,昨天一切都很好。
DELIMITER $$ CREATE DEFINER=`local`@`localhost` PROCEDURE `get_username`(
OUT match_name VARCHAR(50),
str_id INT(5)
)
BEGIN
SELECT username INTO match_name FROM members WHERE id = str_id;
END
Simple SP to retrieve the name behind a id that is called from the mysql client with:
简单的SP检索从mysql客户端调用的id后面的名称:
CALL get_username(37);
What am I missing here?
我在这里想念的是什么?
1 个解决方案
#1
3
`get_username`(
OUT match_name VARCHAR(50),
str_id INT(5)
)
You need 2 parameters, you need to pass in a variable parameter for that output parameter
您需要2个参数,需要传入该输出参数的变量参数
更多相关文章
- MySQL数据库 prompt参数详解
- MyBatis排序时使用order by 动态参数时需要注意,用$而不是# 用$传
- 如果发现自己的mysql没有充分利用CPU该关注那些参数?
- 解析innodb status各项参数
- c语言把mysql数据库语句和变量封装为一个语句
- 如何将对象作为参数传播给函数?
- 如何在javascript函数中将URL编码为参数?
- 范围变量值的变化没有反映在我的字符串中
- 根据循环中的i改变函数中的参数