Can you please tell me if I am using decode correctly in this update statement? I am trying to compare a new and an old value in a trigger code and if the old value is not null and the new value is null, I would like for the value inserted into the table to be blank and not the value 'NULL'. If the new student_id is not null, then to just insert the real value.
ELSE
IF
old.student_flag = 'ACTIVE') AND
new.student_flag = 'ACTIVE') THEN
IF NVL
old.student_id, 'NULL') <> NVL
new.student_id, 'NULL') THEN
UPDATE test.test_student
SET student_id = DECODE
new.student_id, 'NULL', '', :new.student_id)
WHERE student_num =
ld.student_num;
Thanks for your help in advance!
ELSE
IF
IF NVL
UPDATE test.test_student
SET student_id = DECODE
WHERE student_num =
Thanks for your help in advance!