This is the sintax:
CREATE [DEFINER = {user
| CURRENT_USER }]
TRIGGERtrigger_name
{AFTER | BEFORE}
{INSERT | UPDATE | DELETE}
ONtbl_name
FOR EACH ROW {your_body}
An example:
CREATE TRIGGER sdata_insert BEFORE INSERT ON `sometable`
FOR EACH ROW
BEGIN
SET NEW.guid = UUID();
END
;
0 comments:
Post a Comment