Subject | Re: [firebird-support] Detecting default values |
---|---|
Author | Tetram Corp |
Post date | 2011-11-03T21:43:48Z |
I thought about this solution but hoped there was a better one because
of, you're right, in my case the field has a restricted range but i've
an other similar case where there's no limit in value range
too bad. I will use this trick for my first case, and think again about
app design for the second one
thx all
Le 03/11/2011 21:39, Leyne, Sean a écrit :
of, you're right, in my case the field has a restricted range but i've
an other similar case where there's no limit in value range
too bad. I will use this trick for my first case, and think again about
app design for the second one
thx all
Le 03/11/2011 21:39, Leyne, Sean a écrit :
>[Non-text portions of this message have been removed]
> 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
>
>