Subject Re: [IBO] newbie: DEFAULT & NOT NULL
Author Daniel Rail
At 17/07/2002 09:04 PM, you wrote:
>I have a table with a smallint field which has a default value of 25.
>When I use the TIBOQuery, this default value is obeyed, but when I
>use the TIB_Query this default value seems to be ignored. I'm aware
>that I can set this default value through the actual TIB_Query
>component, but this seems to defeat the purpose of setting the
>default values in the gdb metadata.

Set the TIB_Query.GetServerDefaults property to True and IBO will get the
DEFAULT constraints that are on the server. But, you can also set Required
to False for the appropriate fields, so that it's the server that assigns
the default values.

>2) (maybe more of a firebird question)
>In this same table, I have four fields with NOT NULL. When I do an
>insert into this table, and try to post without filling in one of
>these fields, I get the relevant message saying this field cannot be
>null. But when I go back and edit a record, I can clear out these
>values, and I can post the record with blanks in these fields.
>What am I not understanding here??

When you clear out the values they are not set to NULL, but just set as an
empty string. And, an empty string is NOT NULL.

Daniel Rail
Senior System Engineer
ACCRA Group Inc. (
ACCRA Med Software Inc. (