Calling a procedure from Trigger

Reply

Join Date: Oct 2008
Posts: 9
Reputation: bvssam is an unknown quantity at this point 
Solved Threads: 0
bvssam bvssam is offline Offline
Newbie Poster

Calling a procedure from Trigger

 
0
  #1
Dec 31st, 2008
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.


  1. DELIMITER $$
  2.  
  3. DROP PROCEDURE IF EXISTS `test`.`sample` $$
  4. CREATE DEFINER=`root`@`localhost` PROCEDURE `sample`()
  5. BEGIN
  6. INSERT INTO test.out(num,message) SELECT num,name FROM test.IN,hotel
  7. WHERE IN.message = hotel.pin;
  8. END $$
  9.  
  10. DELIMITER ;
  11.  
  12.  
  13. CREATE trigger `pull` after INSERT on `test.IN`
  14. for each row
  15. BEGIN
  16. 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
Last edited by peter_budo; Jan 6th, 2009 at 9:27 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: Calling a procedure from Trigger

 
0
  #2
Jan 1st, 2009
What is the Error that MySQl threw at you ??

Also did you remember to put the "END" at the end of the Trigger.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 9
Reputation: bvssam is an unknown quantity at this point 
Solved Threads: 0
bvssam bvssam is offline Offline
Newbie Poster

Re: Calling a procedure from Trigger

 
0
  #3
Jan 2nd, 2009
Yes I did,

I put the END and tried but it is same as before.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC