MySQL Forums
Forum List  »  Knowledge Base

returning value from trigger
Posted by: John Kuiper
Date: February 06, 2009 07:32AM

Is there a way to get the declared variable back from my trigger, so I can see witch ID is inserted.
this is an example of my trigger

TRIGGER test.trigger1
BEFORE INSERT
ON test.testtable
FOR EACH ROW
BEGIN
DECLARE NewID int;
SELECT MAX(ID)
FROM testtable
INTO NewID;
SET NEW.ID = NewID + 1;
END

Options: ReplyQuote


Subject
Views
Written By
Posted
returning value from trigger
2731
February 06, 2009 07:32AM
2063
February 06, 2009 07:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.