title: Select string as number on Oracle
body: <p>I found this odd behavior and I'm breaking my brains with this... anyone has any ideas?</p>
  
  <p>Oracle 10g:
  I have two different tables, both have this column named "<strong>TESTCOL</strong>" as <strong>Varchar2(10)</strong>, not nullable. </p>
  
  <p>If I perform this query on <strong>table1</strong>, i get the proper results:</p>
  
  <pre><code>select * from table1 where TESTCOL = 1234;
  </code></pre>
  
  <p><strong>Note</strong> that I'm specifically not placing '1234'... it's not a typo, that's a dynamic generated query and I will try not to change it (at least not in the near future).</p>
  
  <p>But, if I run the same query, on <strong>table2</strong>, I get this error message:</p>
  
  <pre><code>ORA-01722: Invalid number
  </code></pre>
  
  <p>Both queries are run on the same session, same database.</p>
  
  <p>I've been joining these two tables by that column and the join works ok, the only problem shows whenever I try to use that condition.</p>
  
  <p>Any ideas on what could be different from one table to the other?</p>
  
  <p>Thanks in advance.</p>