Dec 9, 2010

How to create UUID from MySql Trigger

delimiter//
create TRIGGER sample_insert before INSERT ON sample
FOR EACH ROW
BEGIN
SET NEW.uuid = UUID();
set NEW.clientmask=0;
insert into sample1(tableName,recUUID,clientMask)values(sample, NEW.uuid ,0);
END;

No comments:

Post a Comment