Subject Re: [ib-support] Default Question
Author Helen Borrie
At 01:34 AM 08-02-01 -0500, you wrote:
> I have an edit control linked to VARCHAR(10) field and that field
> contains a value,
>say '428'.
>The field has a DEFAULT of '0'. On the form, I put dataset in Edit and I
>clear the
>entry then Post:
>DEFAULT Specifies a default value for column data; this value is entered
>when no other
>entry is made;
>Will IB consider "no other entry is made" and insert the DEFAULT '0' or
>will it go

On an update, it will go NULL. Defaults only apply to inserts and they are
only set if the insert doesn't specify something in the column. Passing
NULL in the insert statement will cause the column to be NULL. If you
exclude the column from the Values() list in the insert, you will get the

If you need the column to go to zero whenever it gets set null, you'll need
a BU trigger to do that.


All for Open and Open for All
InterBase Developer Initiative ยท