title: Oracle:Difference between NULL and EMPTY string
body: <p>I am in a situation where my query is not returning any values due to oracle behaviour.<br></p>
  
  <p>Problem is this:<a href="http://www.techonthenet.com/oracle/questions/empty_null.php" rel="nofollow noreferrer">Oracle considers <strong>EMPTY STRING</strong> as <strong>NULL</strong> when <strong>INSERTING DATA</strong> but not when <strong>SELECTING BACK</strong> the data</a>.<br></p>
  
  <p>This is not a duplicate of <a href="https://stackoverflow.com/questions/203493/why-does-oracle-9i-treat-an-empty-string-as-null">Why does Oracle 9i treat an empty string as NULL?</a> because here i am not asking for the reason to this problem,i am well aware of the reason,i am asking for a solution to this problem.</p>
  
  <p>This is my table structure</p>
  
  <pre><code>   CREATE TABLE TEST
      (
        ID          NUMBER not null,
        NAME VARCHAR2(255)
      )
  </code></pre>
  
  <p>when inserting the values oracle will accept </p>
  
  <p>INSERT INTO TEST values(1,'');</p>
  
  <p>I found out that internally oracle converts <strong>Strings of Zero length to NULL</strong> and stores<br></p>
  
  <p>But my query </p>
  
  <p>SELECT * FROM TEST
      WHERE NAME = INPUT;(INPUT='')</p>
  
  <p>(Input is passed from front end and will sometimes have empty string)<br>
  will not return any result<br>
  I can not write dynamic query due to performance issue</p>
  
  <p>Somebody who faced this issue before please let me know how do i compare <strong>EMPTY STRING with NULL</strong></p>