Re: unexpected NULL values
Posted in 1998
David Williams wrote:
>
> In article <36487DD2.B00@bayer.co.uk>, Peter Lancashire <Peter.Lancashi
> re.PL1@bayer.co.uk> writes
> >ProzessDV wrote:
> >>
> >> We migrate from an old database (DDB/4) to OWS 7.22 on SCO UNIX. When a row
> >was
> >> inserted on the old system into a char-column by a host variable containing
> >> nothing ( colx = "") the database did not contain anything, either. But
> >> informix inserts a NULL value into this column. Is there a way to leave our
> >> code unchanged but to insert "nothing" ("") instead of a NULL value?
> >>
> >> Thanks in advance,
> >> S'kr'
> >NULL is nothing. You might prefer to have empty strings as blanks
> WRONG!!!! WRONG!!! WRONG!!! SLAP!! WALLOP!! KICK!! SLAP!!!
Ouch. Sorry for touching a raw nerve. Only trying to help.
By "nothing" I meant undefined. I was trying to distinguish
1. nothing = NULL = undefined
2. empty string, zero-length string
3. blank string (a number of spaces > 0)
Option 2 is available only in Online with VARCHAR as CHAR always blank
pads.
>
> NULL=undefined...
>
> NULL != "", since "" is a defined value..
>
> >strings. In a CHAR column, " " will fill the whole of the column with
> >spaces. It compares = to " ".
> >
> >To change: UPDATE mytable SET mycharcol = ' ' WHERE mycharcol IS NULL.
>
> UPDATE mytable SET mycharcol = '' WHERE mycharcol IS NULL.>
[I wish Informix 4GL would distinguish between space characters and
parts of a field which contain nothing (no spaces, not null, nothing).
And how might one distinguish an empty (not null) field from a null
field to a user?]
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
--
If all else fails, read the instructions and the release notes.
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/