Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: substituting a space for a NULL

Re: substituting a space for a NULL

From: Neil Cudd <neil_at_cudd.demon.co.uk>
Date: Fri, 5 Mar 1999 16:52:16 -0000
Message-ID: <920652917.12306.0.nnrp-08.c2de6f3d@news.demon.co.uk>


use the default option :

col1 varchar2 not null default ' '

all subsequent inserts will put a spce in the column if the statement does not
reference the column.

Neil Cudd.
kevon_at_my-dejanews.com wrote in message <7bosue$pdo$1_at_nnrp1.dejanews.com>...
>I'm a SQL novice, so forgive me if the answer to this is obvious.
>
>I'd like to define a table such that for all columns when you try to insert
a
>NULL into a NON NULL column, instead of producing an error, it instead
>inserts a blank (' ').
>
>My reason for doing this is that I am using some software loading data into
>Oracle that I believe is trimming spaces from strings such that ' ' becomes
''
>which is interpreted by Oracle as a NULL value.
>
>Thanks in advance,
>
>Kevon
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Fri Mar 05 1999 - 10:52:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US