MySQL Forums
Forum List  »  Triggers

Re: CALL SP in Trigger
Posted by: Thomas CORBIERE
Date: October 28, 2005 12:23PM

while creating the procedure you can add an OUT parameter :

CREATE PROCEDURE p (OUT return_value INT)
BEGIN
SET return_value = 10 ;
END ;

In the trigger you'll have to tell the procedure in which variable you want to receive the result.

CREATE TRIGGER mytrigger BEFORE INSERT
ON mytable
FOR EACH ROW
BEGIN
CALL p(@myvar) ;
/* Now @myvar will contain the value received in the procedure */
END ;

Hope this can help you,

Thomas CORBIERE

Options: ReplyQuote


Subject
Views
Written By
Posted
5340
October 28, 2005 11:19AM
2478
October 28, 2005 11:47AM
2559
October 28, 2005 11:50AM
Re: CALL SP in Trigger
2449
October 28, 2005 12:23PM
2629
October 29, 2005 01:57AM
2632
October 29, 2005 03:06AM
2293
October 29, 2005 03:21AM
2187
October 29, 2005 03:28AM
4007
February 28, 2006 01:17AM
2696
February 28, 2006 01:39AM
2455
February 28, 2006 02:54AM
2299
February 28, 2006 07:19AM
2293
February 28, 2006 11:15PM
2274
February 28, 2006 11:45PM
2207
February 28, 2006 05:25AM
3419
February 28, 2006 05:46AM
2280
February 28, 2006 06:28AM
2198
March 01, 2006 03:17AM


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.