当你在MySQL中遇到“not allowed to return a result set from a function”这个错误时,这通常意味着你尝试从一个MySQL函数中返回一个结果集,但MySQL的函数设计并不支持这种操作。下面我会详细解释这个问题,并提供一些解决方案。 一、问题背景及原因 MySQL中的函数(Function)通常被设计为返回单一的值,比如一个整数...
出现错误Not allowed to return a result set from a trigger 查找原因是:MYSQL5以后,不允许触发器返回任何结果,因此使用into @变量名,将结果赋值到变量中,用select调用即可 修改为 CREATE TRIGGER newcustomer AFTER INSERT ON customers FOR EACH ROW SELECT 'customer added' INTO @add 此时select @add 发现触发...
因为很多存储过程都会共用一段sql语句,所以我把共用的sql封装成一个自定义函数 AddCapital(); 然后通过存储过程调用,创建存储过程会报错1415,Not allowed to return a result set from a function(不允许从函数返回结果集);因为存储过程返回值为int,你可以定义一个变量接收一下函数的返回值;再执行就没问题了。
在mysql的trigger和function中不能出现select * from table形式的查询,因为其会返回一个结果集;而这在mysql的trigger和function中是不可接受的,但是在存储过程中可以。在trigger和function中可以使用select ... into ...形式的查询。
Re: Not allowed to return a result set from a trigger 5427 Nikos Skatzis February 13, 2007 05:45AM Re: Not allowed to return a result set from a trigger 6195 William Chiquito February 13, 2007 07:05AM Re: Not allowed to return a result set from a trigger ...
# select*from user;# 也会报错,触发器里不能返回值 Not allowed toreturna resultsetfrom a trigger insert intolog(message)values('看到我就说明你没翻车');end $$ delimiter;insert intouser(name,password)values('会翻车吗','可能吧');select*from user;select*from log;# 删除触发器 ...
ERROR 1415 (0A000): Not allowed to return a result set from a trigger 1. 2. 3. 4. 5. 6. 7. 8. 7.2Update触发器无法更改旧值 mysql> delimiter $ mysql> CREATE TRIGGER bu_t1 -> BEFORE UPDATE ON t1 -> FOR EACH ROW -> BEGIN ...
·错误:1130 SQLSTATE: HY000 (ER_HOST_NOT_PRIVILEGED) 消息:不允许将主机'%s'连接到该MySQL服务器。 ·错误:1131 SQLSTATE: 42000 (ER_PASSWORD_ANONYMOUS_USER) 消息:你正在已匿名用户身份使用MySQL,不允许匿名用户更改密码。 ·错误:1132 SQLSTATE: 42000 (ER_PASSWORD_NOT_ALLOWED) ...
RETURN ParentID; END$$ DELIMITER ; i hope you understand the problem.. please help... Subject Views Written By Posted Not allowed to return a result set from a function 14397 Nitin Handa June 20, 2011 11:11PM Re: Not allowed to return a result set from a function ...
I'd like to call this procedure to execute from a trigger, but the "Query OK" response (apparently) causes the trigger to respond with "ERROR 1415 (0A000): Not allowed to return a result set from a trigger". The trigger itself contains no instructions other than a call to the ...