Subject Re: [ib-support] External tables and null values
Author Ann W. Harrison
At 02:56 PM 12/23/2002 +0100, Milan Babuskov wrote:
>Hi all,
>I'm trying to copy data from one database to the other via external
>tables. I have problem with null values. ... all NULL
>values are converted:
>integers become zero
>dates become 17.11.1858

And strings become "".

>Is this behaviour expected?

Yes. An external file has no direct way to represent nulls,
so they turn into zeros or empty strings. Zero as a date
resolves to the "base date" which is 17 November 1858. It's
a VAX thing...

>If so, how to overcome it?

What's done in gbak, the SQLDA - and, in fact, in the database
is to have two physical fields for each logical field. The first
is a byte (a bit in the database) that indicates whether or
not the value is null. The second is the data itself. This
complicates the logic of dumping to and reading from the
external file, but has the advantage of getting the right


We have answers.