Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: IS NULL on empty varChar2
dbyy wrote:
>
> on a IF statement as follow
>
> 1) The attribute Col1 is an empty string <''>
> 2) on the statement (in PL/SQL/trigger) <IF TRIM(Col1) IS NULL>
> it returns TRUE.
>
> IMHO, In this case, Col1 can't be NULL, it should be a (empty) string.
>
Fred - welcome to Oracle. This is an Oracle oddity - basically, we treat zero length strings as NULLs (and a empty string becomes a zero length string depending on the data type) - see http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:5984520277372 for a description. Received on Tue Oct 26 2004 - 21:01:42 CDT