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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Null and empty string program? ( Urgent !!! )

Re: Null and empty string program? ( Urgent !!! )

From: <joe_celko_at_my-deja.com>
Date: Fri, 10 Mar 2000 00:48:56 GMT
Message-ID: <8a9gpn$e0p$1@nnrp1.deja.com>

>> I'm trying to insert a value empty string ( '' ) into a column which
is not null but it return an error to me. <<

This is going to drive you nuts becuase Oracle has gotten this all wrong. In the SQL-92 Standard, all CHAR(n) and VARCHAR(n) -- there is no such crap as VARCHAR2 in real SQL -- must have a value of (n) > 0. When you attempt to store an empty string, it is padded out with blanks. Ergo, uyou cannot store an empty in SQL-92.

Furthermore, SQL-92 is consistent in that NULLs propagate and empty strngs have no effect on concatenation:

    'abc' || NULL = NULL
    'abc' || '' = 'abc'

You have to write a lot of work-around code to get Oracle to act like SQL. Sorry. You should have bought DB2.

--CELKO-- Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Mar 09 2000 - 18:48:56 CST

Original text of this message

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