Subject RE: [firebird-support] Detecting default values
Author Leyne, Sean
Ismael,

> In the trigger:
>
> if (new.myfield is null) then

This will not be able to distinguish the condition:

> But now, i'm facing a new challenge: how to detect if the null status I
> received in new.myfield is because the field was not in the insert
> statement or because the insert statement set it to null ?
>
> well, from
> insert into mytable (field1) values (:field1)
> or from
> insert into mytable (field1, myfield) values (:field1, null)

Doug Chamberlin's solution is the right one, though with a possible problem if the full range of values for the field are valid within an INSERT statement (in which case no "dummy" default value could be defined).


Sean