943,821 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 4545
  • MySQL RSS
Dec 31st, 2008
0

Calling a procedure from Trigger

Expand Post »
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.


sql Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008
Jan 1st, 2009
0

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.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Jan 2nd, 2009
0

Re: Calling a procedure from Trigger

Yes I did,

I put the END and tried but it is same as before.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bvssam is offline Offline
9 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Union Site Search with Relevance
Next Thread in MySQL Forum Timeline: MySQL Cluster 101 Webcast





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC