MySQL Forums
Forum List  »  Triggers

Trigger Before Delete
Posted by: Mark Web
Date: October 11, 2016 12:49PM

Hi I have created the below trigger to only trigger if the user is not user admin to stop the delete but it currently stops even admin ( basically stop anyone from deleting).

CREATE TRIGGER `oc_share_before_delete` BEFORE DELETE ON `oc_share` FOR EACH ROW BEGIN
IF oc_share.uid_initiator != 'admin' THEN
SIGNAL SQLSTATE '45000';
END IF;
END

Mark

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger Before Delete
1031
October 11, 2016 12:49PM
469
October 11, 2016 03:53PM


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.