开发者

mysql Trigger Issue "in wrong schema"

开发者 https://www.devze.com 2023-03-12 19:13 出处:网络
I am running delimiter // create trigger beforeYourTableUpdateBEFORE UPDATE on YourTable FOR EACH ROW BEGIN

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号