问题
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