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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: handling of empty string (strange)

Re: PL/SQL: handling of empty string (strange)

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Thu, 11 Mar 2004 16:09:21 +0100
Message-ID: <405080ee$0$304$636a15ce@news.free.fr>

"stephan" <stephan0h_at_yahoo.de> a écrit dans le message de news:af65e20e.0403110647.746a12bc_at_posting.google.com...
> Hi everybody,
>
> I've got this code-sample here which puzzles me:
>
> declare
> s VARCHAR2(1):='S';
> begin
> dbms_output.put_line(s);
> if s!='' then
> dbms_output.put_line('hoppla');
> else
> dbms_output.put_line('ballaballa');
> end if;
> end;
> /
>
> When run the program enters the else-branch. But why - 'S'!='' must
> certainly be true!?
>
> Thanks,
> Stephan

As we said it here many and many times '' is NULL, so 'S' != '' is equivalent to 'S' != NULL which is NEVER true.

Regards
Michel Cadot Received on Thu Mar 11 2004 - 09:09:21 CST

Original text of this message

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