Subject use a trigger to set a field to null
Author martinknappe
hi

i have an (after-update) trigger which looks like the following:

update dicentries
set
asdskrpt1 = new.asdskrpt1
where
asverwid = new.id;

it works fine except under one condition:

if
asdskrpt1
of
new.id
was just set to null,
then
asdskrpt1 where asverwid = new.id
remains unchanged

so i tried with the following modification of the trigger (which
doesnt work either):

update dicentries
set
asdskrpt1 = new.asdskrpt1
where
asverwid = new.id;
if new.asdskrpt1 is null then
set
asdskrpt1 = null
where
asverwid = new.id;

does anyone see whats the problem here?

thanx,

martin