MySQL Forums
Forum List  »  Triggers

Re: CALL A PROCEDURE USING TRIGGERS
Posted by: William Chiquito
Date: November 09, 2006 05:05AM

Hi Merlin,

It is possible with some limitations.

script:

DELIMITER $$

DROP TRIGGER `p`$$

CREATE TRIGGER `p` AFTER INSERT on `t1`
FOR EACH ROW
BEGIN
CALL spprueba(NEW.id);
END$$

DELIMITER ;

DELIMITER $$

DROP PROCEDURE IF EXISTS `spprueba`$$

CREATE PROCEDURE `spprueba` (pid INT)
BEGIN
/* it does not work */
/* Not allowed to return a result set from a trigger */
SELECT * FROM t1;

/* it work */
INSERT INTO t2 (id) values (pid);
END$$

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: CALL A PROCEDURE USING TRIGGERS
14581
November 09, 2006 05:05AM


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.