I am running
delimiter //
create trigger beforeYourTableUpdate BEFORE UPDATE on YourTable
FOR EACH ROW
BEGIN
SE开发者_开发问答T new.guid_column := (SELECT UUID());
END
//
delimiter; [edit]
UPDATE YourTable set guid_column = (SELECT UUID());
DROP TRIGGER beforeYourTableUpdate;
And everytime I run this - I get the error "Trigger in wrong schema" using MySQL 5.5
Any ideas why this would be ?
You didn't reset the delimiter, you might want to add
delimiter ;
You have to add the schema you're working with. On the top, add:
use 'yourWorkingSchema';
That should solve the problem.
精彩评论