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

What is the Error that MySQl threw at you ??

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

Yes I did,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.