Why is my “before update” trigger changing unexpected columns?

我只是一个虾纸丫 提交于 2019-12-24 07:14:31

问题


I have a table USERS with a varchar column LoginId. I am trying to use a before update trigger to change the incoming value to lower case. This is what I have done so far. It changes the value to lower case. But it also changes all other column to their default values.

CREATE TRIGGER TOLOWER BEFORE UPDATE ON USERS 
REFERENCING NEW AS N OLD AS O FOR EACH ROW MODE DB2SQL
set N.LoginId= lcase(N.LoginId)

Is this trigger correct? If not then what changes should should I do ?

来源:https://stackoverflow.com/questions/39050910/why-is-my-before-update-trigger-changing-unexpected-columns

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