DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   Calling a procedure from Trigger (http://www.daniweb.com/forums/thread165160.html)

bvssam Dec 31st, 2008 4:33 am
Calling a procedure from Trigger
 
Hi Group,

I have a small Query regarding calling a procedure from a trigger
please go through the following and please let me knwo if any thing wrong happened.


DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`sample` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sample`()
BEGIN
  insert into test.out(num,message) select num,name from test.in,hotel
  where in.message = hotel.pin;
END $$

DELIMITER ;


 create trigger `pull` after insert on `test.in`
 for each row
 begin
 call sample();

When I tried to create a trigger to call the procedure it is throwing error.

so please solve my small Query

Thanks in advance

stephen84s Jan 1st, 2009 12:55 pm
Re: Calling a procedure from Trigger
 
What is the Error that MySQl threw at you ??

Also did you remember to put the "END" at the end of the Trigger.

bvssam Jan 2nd, 2009 12:35 am
Re: Calling a procedure from Trigger
 
Yes I did,

I put the END and tried but it is same as before.


All times are GMT -4. The time now is 6:32 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC