Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: blank fields in Oracle
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
![]() |
![]() |