What are the values of columns which are not set in a BEFORE UPDATE trigger?

淺唱寂寞╮ 提交于 2019-12-13 03:59:47

问题


According to MySQL

In a before update trigger there are two mysql extensions viz NEW and OLD to refer to the old and new column values of the updating row.

Say, my table is :

            create table foo ( id primary key auto_increment,
                           fname varchar(10),
                           lname varchar(10) 
                         );

And I have inserted 1 row:

            insert into foo (fname,lname) values ("Edam","Chuti");

If I run an update like :

            update foo set fname="Edam1" where id=1;

Then in my before update trigger for this table what will be the values of :

            NEW.fname=?
            NEW.lname=?

来源:https://stackoverflow.com/questions/26083724/what-are-the-values-of-columns-which-are-not-set-in-a-before-update-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!