July 22nd, 2013, 03:18 PM
My trigger isn't working
Hello folks, today I had to create a trigger for one of the website we're working on. The problem is that this website uses MySQL and normally I work with Oracle. I wrote the following trigger but it keeps saying that there's an error on the cursor declaration.
I seriously don't know where the problem is, maybe you could enlighten me .
TRIGGER `feusers_before_update` BEFORE UPDATE
FOR EACH ROW BEGIN
DECLARE curMinistry CURSOR FOR SELECT category_members FROM tx_addstaticministry_organisme WHERE uid=new.tx_extendfeuserfj_ministere_organisme;
DECLARE catMember INT;
FETCH curMinistry INTO catMember;
SET new.tx_extendfeuserfj_categorie_membre = catMember;