Problem Report: hints in Program Window

ScottMattes

Member³
I just got

Error: Hint: Comparison with NULL in 'my_code'
Line: 2706
Text: IF something = ''

The compiler doesn't think that '' is the same as NULL (I tried changing the = to IS and recompiled - that threw a complier error), so why the hint?
 

Code:
SQL> select 1 from dual where '' is null;
         1
----------
         1

The compiler most definitely thinks that '' is the same as NULL, because it is.
 
O, I thought that because of this:

Code:
SQL> select * from dual where dummy = '';
DUMMY
-----

SQL> select * from dual where dummy is '';
select * from dual where dummy is ''
ORA-00908: missing NULL keyword

SQL> select * from dual where dummy is null;
DUMMY
-----

SQL>

that null and '' were different. Stewpid me.

p.s. yup, I was wrong -http://www.techonthenet.com/oracle/questions/empty_null.php
 
Last edited:
Back
Top