title: oracle long to number conversion
body: <p>I am trying to get the name of the current partition from all_tab_partitions table. When i try to compare high_value (long data Type) and number. It throws an error:</p>
  
  <blockquote>
    <p>ORA-00997: illegal use of LONG datatype</p>
  </blockquote>
  
  <pre><code>SELECT PARTITION_NAME, HIGH_VALUE FROM ALL_TAB_PARTITIONS
  WHERE TABLE_OWNER='SCHEMA_NAM'
  AND TABLE_NAME='TABLE_NAME'
  AND HIGH_VALUE&gt;to_number(TO_CHAR(TRUNC(ADD_MONTHS(SYSDATE, 1), 'MONTH'), 'YYYYDDD'))
  /
  </code></pre>