Subject | Re: use a trigger to set a field to null |
---|---|
Author | Adam |
Post date | 2006-11-01T22:24:20Z |
--- In firebird-support@yahoogroups.com, "martinknappe" <martin@...>
wrote:
you could generate a simple SQL script to create the two tables and
the trigger, and then to populate it with a record and run an update
statement to show what you mean.
Adam
wrote:
>This is not valid. It looks like you forgot the 'update table' logic.
> 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 thenI am not sure what would be wrong with the original statement. Perhaps
> set
> asdskrpt1 = null
> where
> asverwid = new.id;
you could generate a simple SQL script to create the two tables and
the trigger, and then to populate it with a record and run an update
statement to show what you mean.
Adam