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

Home -> Community -> Usenet -> c.d.o.tools -> Re: '' IS NULL?

Re: '' IS NULL?

From: R. Dickhout <Reinier_Dickhout_at_hetnet.nl>
Date: Mon, 11 Dec 2000 16:22:23 +0100
Message-ID: <Om5FOX4YAHA.291@net025s>

Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK> wrote >
>They ARE the same thing. Oracle explicitly states that '' is NULL.
> >
> >Reinier.
> >
> Hmm.. Missed that then. I'll keep an eye out for that in the docs.
> Thanx.
>
> Brian
>

Just for your information, the following text comes from the PL/SQL user guide and reference version 8.0:

Zero-Length Strings

PL/SQL treats any zero-length string like a null. This includes values returned by character functions
and Boolean expressions. For example, the following statements assign nulls to the target variables:

null_string := TO_VARCHAR2('');
zip_code := SUBSTR(address, 25, 0);
valid := (name != '');

So, use the IS NULL operator to test for null strings, as follows:

IF my_string IS NULL THEN ...

Regards,

Reinier. Received on Mon Dec 11 2000 - 09:22:23 CST

Original text of this message

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