MySQL用户定义的过程返回“boo!”何时被叫

时间:2015-10-31 20:58:14

标签: mysql

是我的程序代码的总和。

除了呼叫声明外,一切都在运行:

call rlbsddb.Get_TD_Roles('userid', 'dbname', 'tblname', '@TS')
Error Message Returned: boo!

我知道MySQL有错误的错误消息,但是'嘘!'???

代码的总体目标是运行3个语句,收集有关访问的详细信息。返回插入的DateTime,然后使用它拉实际结果。

实际结果是在代码中插入的0-10行。 为什么这不起作用?

DELIMITER $$
DROP PROCEDURE IF EXISTS rlbsddb.Get_TD_Roles$$

create PROCEDURE rlbsddb.Get_TD_Roles (in pEID varchar(30), 
                in pDBName varchar(30), in pTBLName varchar(30), out RUN_TS datetime)
    LANGUAGE SQL
    NOT DETERMINISTIC
    SQL SECURITY DEFINER
BEGIN

set @CURR_TS = current_timestamp;
select @CURR_TS into RUN_TS;

/* Do Some Stuff */
/* Original Code uses variables to locate a multiple row response 
   Multiple row response is then added into the tmp_for_example_only table
   and after call, information is pulled using a select */

insert into rlbsddb.tmp_for_example_only
select pEID, pDBName, pTBLName, @CURR_TS;

END $$

call rlbsddb.Get_TD_Roles('userid', 'dbname', 'tblname', @TS)$$
/* I've tried this with '@TS' as well */
/* I've also tried "show warnings$$" in front of the call and just after the call, nothing returned */

select * 
from rlbsddb.tmp_for_example_only
where inserted_dtim = @TS
and user_id = 'userid'
and DBName = 'dbname'
and TBLName = 'tblname'$$

0 个答案:

没有答案