Subject Default NULL
Author Jerry Sands
I am using IBO V4.2If TEST and I was having some problems inserting a row in
one of my tables. I get an exception:

EConvertError - "NULL' is not a valid integer value'

It turns out that one of the columns in the table is causing the error is
defined as follows:

CUSTEMPLOYEENUMBER INTEGER DEFAULT NULL,

Now I designed this database over 7 years ago and in retrospect maybe this
is not necessarily a good default to have but it is valid. (Actually there
is a lot of things I would have done different!) I have traced the error to
the following IBO code in IBA_Dataset.IMP procedure
TIB_Dataset.SysGetServerDefaults2. At line 4399 is the following:

if not (csDesigning in Self.ComponentState) and not PreSetDefaults
then
AsString := FdefaultValue

FdefaultValue is = 'NULL' as fetched from the table schema and cannot be
converted to an integer.

This change allows the NULL default thru but not having much experience with
the IBO code I thought I might run this by others to see if this would not
break anything else.

if not (csDesigning in Self.ComponentState) and not PreSetDefaults
then
{$ifdef original}
AsString := FDefaultValue
{$else}
if FDefaultValue <> 'NULL' then
AsString := FDefaultValue
else
Clear
{$endif}


Any feedback would be appreciated!

Jerry Sands