RE: Question about NULL's - no-MIME version
Posted in 2000
Before alter column to NOT NULL, you have to initialize the column with
space (so the column will not include any nulls) e.g.
update table_name
set moto = ' '
where moto is null
HTH
Mukund Shevkar
-----Original Message-----
From: Stephen F. Cawley [mailto:sfcawley@interaccess.com]
Sent: Monday, August 28, 2000 10:08 AM
To: Ralf Heydenreich
Cc: informix-list@iiug.org
Subject: Re: Question about NULL's - no-MIME version
Alter the column to NOT NULL?
> Sorry, here comes the no-MIME version...
>
> Hi,
> I have the following problem: A table in my database has some constraint
> checks. There are also fields with only one space in it (' '). The
> output from dbschema is
> quite correct.
> Output from dbschema:
> ...
> check (benz IN ('N' ,'S' ,'D' ,'B' ,'P' ,' ' )),
> check (kat IN ('G' ,'U' ,' ' )),
> check (heck IN ('F' ,'S' ,'G' ,'W' ,' ' ,'L' )),
> check (antr IN ('A' ,'V' ,'H' ,' ' )),
> check (blei IN ('B' ,' ' )),
> check (moto IN ('O' ,'D' ,'R' ,'Z' ,' ' )),
> check (abga IN ('1' ,'2' ,'A' ,'B' ,'C' ,' ' )),
> ...
>
> But - if I test the same table in dbaccess (Info - Constraint -Checks) I
> get the following:
> Output from inside dbaccess:
> Constraint name Value
> c928_8451 (benz IN ('N' ,'S' ,'D' ,'B' ,'P' ,' ' ))
> c928_8453 (kat IN ('G' ,'U' ,' ' ))
> c928_8469 (heck IN ('F' ,'S' ,'G' ,'W' ,'' ,'L' ))
> c928_8477 (antr IN ('A' ,'V' ,'H' ,' ' ))
> c928_8482 (blei IN ('B' ,' ' ))
> c928_8484 (moto IN ('O' ,'D' ,'R' ,'Z' ,'' ))
> c928_8493 (abga IN ('1' ,'2' ,'A' ,'B' ,'C' ,' ' ))
>
> Note, that some fields have the ''-value - that's a NULL!!! But I don't
> want have NULLs in my tables! How can I correct this?
>
> R. Heydenreich