Subject | Re: [firebird-support] Detecting default values |
---|---|
Author | Doug Chamberlin |
Post date | 2011-11-03T18:41:31Z |
On 11/3/11 2:04 PM, Tetram Corp wrote:
fields are not included in the insert statement, as in your first case.
Therefore, if you set a default value that is recognizable and also use
a before insert trigger, in the trigger you can use the default value to
distinguish between the cases. The trigger can then always set the
appropriate default value and replace the dummy one fro the schema.
Try it!
> How to detect if the null status IAFAIR, default values, as provided in the schema, are only used when the
> 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)
fields are not included in the insert statement, as in your first case.
Therefore, if you set a default value that is recognizable and also use
a before insert trigger, in the trigger you can use the default value to
distinguish between the cases. The trigger can then always set the
appropriate default value and replace the dummy one fro the schema.
Try it!