Error Code: 1415. Not allowed to return a result set from a trigger

ying7690's Avatar, Join Date: Jul 2011
Newbie Member
I have the following code for trigger
the syntax message was

"Error Code: 1415. Not allowed to return a result set from a trigger"

Code:
delimiter $$   CREATE TRIGGER  New_User AFTER INSERT ON  tblAdmin   FOR EACH ROW  BEGIN  DECLARE _AdminRECID char(36);  DECLARE _CreateUser varchar(50);  DECLARE _CreateDate datetime;  DECLARE _AuditUser varchar(50);  DECLARE _AuditDate datetime;  DECLARE _MenuRECID CHAR(36);   SELECT RECID = _AdminRECID, 	    CreateUser = _CreateUser, 	    CreateDate = _CreateDate, 	    AuditUser  = _AuditUser, 	    AuditDate  = _AuditDate  FROM tblAdmin;    SELECT RECID = _MenuRECID FROM tblMenu;    	  INSERT INTO tblAdmin_Access(RECID,AdminRECID,MenuRECID,Status,   CreateUser,CreateDate,AuditUser,AuditDate) 	 VALUES (UUID(),_AdminRECID,_MenuRECID,'A', _CreateUser,CURDATE(),_AuditUser,CURDATE());     END;
0
ying7690's Avatar, Join Date: Jul 2011
Newbie Member
I have the following code for trigger
the syntax message was

"Error Code: 1415. Not allowed to return a result set from a trigger"

Code:
delimiter $$

CREATE TRIGGER  New_User AFTER INSERT ON  tblAdmin

FOR EACH ROW
BEGIN
DECLARE _AdminRECID char(36);
DECLARE _CreateUser varchar(50);
DECLARE _CreateDate datetime;
DECLARE _AuditUser varchar(50);
DECLARE _AuditDate datetime;
DECLARE _MenuRECID CHAR(36);

SELECT RECID = _AdminRECID,
       CreateUser = _CreateUser,
       CreateDate = _CreateDate,
       AuditUser  = _AuditUser,
       AuditDate  = _AuditDate
FROM tblAdmin;

SELECT RECID = _MenuRECID
FROM tblMenu;



    INSERT INTO tblAdmin_Access(RECID,AdminRECID,MenuRECID,Status,CreateUser,CreateDate,AuditUser,AuditDate)
    VALUES (UUID(),_AdminRECID,_MenuRECID,'A',_CreateUser,CURDATE(),_AuditUser,CURDATE());


END;
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Please don't create two separate threads and I have merged both of them for you.
0
ying7690's Avatar, Join Date: Jul 2011
Newbie Member
thanks.because i cant remove the previous thread...