char database types blanks and nulls
Posted in 1992
Rob,
In article <1992Oct12.225029.2143@advtech.uswest.com> Rob Yslas posted
the following code:
>$string column1[20];
>$declare test_curs cursor for
>select distinct column1
>into $column1
>from test_table
>where column1 is not null;>$open test_curs;
>$fetch test_curs;
He then stated that using the string datatype, trailing spaces would
be truncated (interesting, I didn't know that but I don't have the
Esql/C manuals).
Your cursor will certainly not return fields that have actually been
written with the NULL value. However, imagine a field that has been
written to the table SPACE filled. It will be returned by the cursor.
The action of the string data type (by Rob's definition) leaves it
clipped. Informix has no option, therefore, but to leave the
variable with a NULL value.
Hope this helps
Regards
Neil
Neil S. Briscoe Telephone: +44 252 376737
System Administrator Fax: +44 252 376644
Email: neil@salmon.demon.co.uk
nbriscoe@cix.compulink.co.uk
Bartec Medical Systems Ltd.
Impression House
Invincible Road "!##@!** Listen who swears
Farnborough Christopher Robin has fallen downstairs"
Hants GU14 7NP -- The Goodies Book of Criminal Records
England
"A man is incomplete until he's married -- then he's finished!"
-- seen on a desktop calendar