title: Dynamic length on number format in to_number Oracle SQL
body: <p>I have a table with numbers stored as <code>varchar2</code> with '.' as decimal separator (e.g. '5.92843').</p>
  
  <p>I want to calculate with these numbers using ',' as that is the system default and have used the following <code>to_number</code> to do this:</p>
  
  <pre><code>TO_NUMBER(number,'99999D9999','NLS_NUMERIC_CHARACTERS = ''.,''')
  </code></pre>
  
  <p>My problem is that some numbers can be very long, as the field is <code>VARCHAR2(100)</code>, and when it is longer than my defined format, my <code>to_number</code> fails with a <code>ORA-01722</code>.</p>
  
  <p>Is there any way I can define a dynamic number format? 
  I do not really care about the format as long as I can set my decimal character.</p>