13.16. ERROR 1415: Not allowed to return a result set from a trigger

简介:

触发器中不允许返回结果集,解决方法是顶一个变量,然后将返回值返回给变量。

		
DROP TRIGGER IF EXISTS `test`.`demo_AFTER_INSERT`;

DELIMITER $$
USE `test`$$
CREATE DEFINER=`root`@`%` TRIGGER `test`.`demo_AFTER_INSERT` AFTER INSERT ON `demo` FOR EACH ROW
BEGIN
	set @rev = "";
	SELECT 
    OUT2FILE('/tmp/demo.log',
            CONCAT_WS(',',
                    NEW.id,
                    NEW.name,
                    NEW.sex,
                    NEW.address))
	INTO @rev;
END$$
DELIMITER ;		
		
		

Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
2月前
|
并行计算 Python
Python错误笔记(一):CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up env
这篇文章讨论了CUDA初始化时出现的未知错误及其解决方案,包括重启系统和安装nvidia-modprobe。
200 0
|
7月前
|
资源调度 前端开发
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
498 0
|
7月前
|
API Android开发 开发者
failed to set system property error code: 0x18
failed to set system property error code: 0x18
338 1
|
7月前
|
Python
gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
184 1
|
7月前
|
druid Java
Error attempting to get column ‘createTime‘ from result set的异常
Error attempting to get column ‘createTime‘ from result set的异常
443 0
|
7月前
|
XML Java 数据库连接
mybatis和mybatiplus中Error attempting to get column ‘xx‘ from result set
mybatis和mybatiplus中Error attempting to get column ‘xx‘ from result set
194 0
|
分布式计算 Hadoop 大数据
|
分布式计算 Java Hadoop
Error: JAVA_HOME is incorrectly set. Please update C:\hadoop-2.5.1\conf\hadoop-env.cmd ‘
Error: JAVA_HOME is incorrectly set. Please update C:\hadoop-2.5.1\conf\hadoop-env.cmd ‘
|
关系型数据库 MySQL Shell
[ERROR] COLLATION ‘utf8_unicode_ci‘ is not valid for CHARACTER SET ‘latin1‘
[ERROR] COLLATION ‘utf8_unicode_ci‘ is not valid for CHARACTER SET ‘latin1‘