title: Oracle ORA-01722: invalid number Error because of WHERE IS NULL Condition
body: <p>I have the following SQL:</p>
  
  <pre><code>Select MyNumber
  FROM (SELECT to_number(Name) AS MyNumber
      FROM TableA
      WHERE regexp_replace(Name, '\d+') IS NULL)
  </code></pre>
  
  <p>The Query is supposed to filter out non-numeric Names from TableA by checking if nothing is left, if all Digits are replaced with nothing.</p>
  
  <p>Can someone explain why I get an "Invalid Number"-Exception when I add the following WHERE Condition as an outer WHERE:</p>
  
  <pre><code>WHERE MyNumber IS NULL
  </code></pre>
  
  <p>How is it relevant, what type MyNumber is? In particular, I would also like to know, why I DO NOT get an error, when I negate the condition:</p>
  
  <pre><code>WHERE NOT MyNumber IS NULL
  </code></pre>
  
  <p>Thanks in advance for any help.</p>