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: Andy Hassall <andy_at_andyh.co.uk>
Date: Sun, 14 Mar 2004 22:03:01 +0000
Message-ID: <0il950pqrbci6grjrrkh9pvooeat7o1a76@4ax.com>


On 11 Mar 2004 06:47:06 -0800, stephan0h_at_yahoo.de (stephan) wrote:

>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!?

 Oracle treats the empty string as NULL.

-- 
Andy Hassall <andy_at_andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Received on Sun Mar 14 2004 - 16:03:01 CST

Original text of this message

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