Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: handling of empty string (strange)
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