MySQL Forums
Forum List  »  Triggers

Re: Accessing NEW.x values from within stored procedures called by triggers
Posted by: Beat Vontobel
Date: November 03, 2005 11:31AM

Thanks, Roland, that works. It's just that I actually wanted to have a clean reusable stored procedure to not have such a mess in every single trigger. Instead of just

... FOR EACH ROW CALL check_data(NEW.a, NEW.b, NEW.c, ...)

the trigger will now look something like this

... FOR EACH ROW
BEGIN
DECLARE new_a TYPE DEFAULT NEW.a;
DECLARE new_b TYPE DEFAULT NEW.b;
DECLARE new_c TYPE DEFAULT NEW.c;
...
CALL check_data(new_a, new_b, new_c, ...);
SET NEW.a = new_a;
SET NEW.b = new_b;
SET NEW.c = new_c;
...
END

Like this I could of course directly drop the stored procedure and include everything directly in the trigger ;-)

What do you think, probably something for a feature request? Taking votes...

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Accessing NEW.x values from within stored procedures called by triggers
2142
November 03, 2005 11:31AM


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.