MySQL Forums
Forum List  »  Triggers

Re: Syntax Trigger in Mysql
Posted by: jororemy jor
Date: October 14, 2015 01:10AM

There is not really a mistake, it's just that when I execute the trigger from phpmyadmin, this is not an error, but it is cut at this level and the other party suddenly jumps

DROP TRIGGER IF EXISTS et_update_dru//
CREATE TRIGGER mdm_et_update_dru
AFTER UPDATE ON mdm_et_emp_pa
FOR EACH ROW
BEGIN
DECLARE uiduser,uidrole INT;
SELECT u.uid INTO uiduser
FROM user u
WHERE u.ref_id = NEW.ref_per and u.ref_a = NEW.ref_a;

IF uiduser IS NOT NULL THEN
UPDATE user
SET ref_id = NEW.ref_per, ref_a = NEW.ref_a, mail = NEW.mail, na = NEW.lo, pass = MD5(NEW.pa), sts = 1
WHERE ref_id = NEW.ref_per and ref_a = NEW.ref_a;
ELSE
INSERT INTO user (ref_id, ref_a, mail, na, pass, sts)
VALUES (NEW.ref_per, NEW.ref_a, NEW.mail, NEW.lo, MD5(NEW.pa), 1);

END IF;

Options: ReplyQuote


Subject
Views
Written By
Posted
2256
October 13, 2015 08:51AM
1108
October 13, 2015 12:26PM
Re: Syntax Trigger in Mysql
1504
October 14, 2015 01:10AM
1184
October 14, 2015 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.