MySQL Forums
Forum List  »  Triggers

Trigger not being saved to information_schema
Posted by: L Mccann
Date: February 19, 2011 08:53AM

Hello,
When I create this trigger, mysql says "Your SQL query has been executed successfully." So I tried to make the trigger fire in the application, and it doesn't work. Then I looked at the Information Schema table in mysql and saw the trigger was not added.

When I run this code without the trigger information included, the code does the work its supposed to do. So I know it works. For some reason, it just will not save the trigger.

Can anyone please provide some suggestions on why it might not be saving?

Thank you!
Linda

DELIMITER $$
CREATE TRIGGER insertgrpmember AFTER INSERT ON zGroupSync
FOR EACH ROW
BEGIN

SET @getname = (SELECT distinct name FROM mdl_cohort mc, zGroupSync zgs WHERE mc.id = zgs.cohortid);
SET @getgroupid = (SELECT id FROM mdl_groups mg WHERE mg.name = @getname);

INSERT INTO mdl_groups_members
(groupid, userid, timeadded)

SELECT @getgroupid AS groupid, userid, timeadded
FROM zGroupSync;

END $$

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger not being saved to information_schema
3171
February 19, 2011 08:53AM


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.