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: blank fields in Oracle

Re: blank fields in Oracle

From: FC <flavio_at_tin.it>
Date: Thu, 13 Mar 2003 14:07:46 GMT
Message-ID: <Sg0ca.73179$zo2.1898550@news2.tin.it>

Did you try using the CHAR datatype?
If you use CHAR, the minimum length is 1, max is 2000 (at least in version 8.1.7), if you insert a zero length string, Oracle will pad it with a blank automatically.
Oracle treats zero length strings as nulls, you can easily test this situation executing the following sql:

SELECT NVL2(TRIM(' '), 'NOT NULL', 'NULL') FROM DUAL; result: 'NULL'

SELECT NVL2(TRIM('X'), 'NOT NULL', 'NULL') FROM DUAL; result: 'NOT NULL'

Bye,
Flavio Received on Thu Mar 13 2003 - 08:07:46 CST

Original text of this message

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