Re: unload and null values
Posted in 1999
Carpenter, Matthew wrote:
>
> I tried this also.
> unload to test.unl select col1, "" from table>
> I received this:
>
> 1||
> 2||
> 3||
> 4||
> 5||
>
> Just to make sure I had a null in the second column I created a
> table that would not accept nulls in the second column. I tried
> to load the new .unl file into the test table. I received
> an error that said unable to insert null into column.
>
> On-Line 7
A while ago, I asked the trivia question:
When does SE return a VARCHAR value?
The answer is that in 7.x SE, when you SELECT "", it is treated
as a zero-length VARCHAR string. Further, a zero-length VARCHAR
string is distinct from a NULL VARCHAR; the first has an on-disk
representation of a single zero byte, but the second has a 2-byte
representation with values 0x01 0x00 (length one, value zero).
However, it is not possible to distinguish between the two plain
text (UNLOAD format) representations - which is irritating but so.
In earlier versions, SELECT "" was equivalent to a CHAR(1) with a
value of ' ', I believe.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>