Subject | use a trigger to set a field to null |
---|---|
Author | martinknappe |
Post date | 2006-11-01T10:48:21Z |
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
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