Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   Trigger Error - ERROR 1415 (0A000): Not allowed to return a result set from a trigger (http://www.go4expert.com/forums/trigger-error-error-1415-0a000-allowed-t17604/)

amit_27 19May2009 11:25

Trigger Error - ERROR 1415 (0A000): Not allowed to return a result set from a trigger
 
Hi,

I have created a trigger which is giving me an error "ERROR 1415 (0A000): Not allowed to return a result set from a trigger":
Code:

CREATE TABLE t1(idencol INT AUTO_INCREMENT,DUMMYCOL INT NOT NULL, PRIMARY KEY(CLIDENTCOL));
GO;
CREATE TRIGGER tri1 BEFORE INSERT ON t2
FOR EACH ROW
BEGIN
DECLARE PN INT;
DECLARE TAB_COLU VARCHAR(10);
DECLARE done INT DEFAULT 0;
DECLARE TRG_CURSOR CURSOR FOR SELECT FNAME FROM INSERTED;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN TRG_CURSOR;

REPEAT
FETCH TRG_CURSOR INTO TAB_COL;   
  IF NOT done THEN
    BEGIN
    DELETE FROM amit.t1 WHERE DUMMYCOL = 0;
    INSERT INTO amit.t1 (DUMMYCOL) VALUES(0);
    SELECT @PN = @@IDENTITY;
    INSERT INTO amit.CLtable VALUES (@SynchPointNumber, 14);
    INSERT INTO amit.CLMtable VALUES (TAB_COL, @PN, 'I');
      END;
  END IF;
UNTIL done END REPEAT;

CLOSE TRG_CURSOR;
END
$


As I am newbie to MySQL not cleared about where it is indicating.

jstf 30Sep2010 05:39

Re: Trigger Error - ERROR 1415 (0A000): Not allowed to return a result set from a tri
 
I suggest you to check your trigger'snytax ,sometimes wrong triggers'spelling also can cause this error! And you'd better show tables related to the table t1 and t2!


All times are GMT +5.5. The time now is 01:31.