Re: blanks to null
Posted in 2000
Obnoxio The Clown — — source: Informix-list mailing list archive (1991-1998)
From: triggerfish2001@hotmail.com
>
>I need to move data from one table to other. basically I am doing
> insert into new_table
> select fld1, fld2, ....
> from old_table
> where ....
Have you tried
INSERT...
SELECT fld1,
CASE WHEN fld2 = " " THEN NULL ELSE fld2 END,
......
?
>now one of the char columns in old_table has many blank data. I want to
>insert
>it to the new_table as null when blank. How can I accomplish this in the
>select statement itself. I tried to use DECODE function but is not working.
>
>any pointers.
>
>TIA.
>
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com