title: ORACLE | SUBSTR function not working
body: <p>I'm having an issue regarding SUBSTR function.</p>
  
  <p>Imagine the table (<strong>TABLE1</strong>):</p>
  
  <pre><code>ABC_DEF   DESCRIPTION
  --------  -------------
  0999      TEST INFO
  </code></pre>
  
  <p>If I do this query:</p>
  
  <pre><code>SELECT * FROM TABLE1 
  WHERE 
  (
       ABC_DEF = '0999'
  )
  </code></pre>
  
  <p>I get this results:</p>
  
  <pre><code>ABC_DEF   DESCRIPTION
  --------  -------------
  0999      TEST INFO
  </code></pre>
  
  <p>However if I do this:</p>
  
  <pre><code>SELECT * FROM TABLE1 
  WHERE 
  (
       ABC_DEF = SUBSTR('00000999', 5, 4)
  )
  </code></pre>
  
  <p>I get 0 results. I don't understand the behavior at all. The attribute ABC_DEF is a char(8).</p>