8 Replies Latest reply on Feb 2, 2012 2:25 PM by 849776

    Converting a VARCHAR to NUMBER

    user263656
      Hello everyone,
      I wonder if you can help me. I have a VARCHAR column called "COLUMN_X" and the value of this column is:
      15.41854 
      and I'm trying to insert this column into COLUMN_Y of another table, and COLUMN_Y is a NUMBER. When I try to convert COLUMN_X into NUMBER I get an error because there is a blank space after the values on "COLUMN_X". What function can I use to get rid of the space behind the values in "COLUMN_X" so that I can convert it successfully?

      So basically I'm trying to do the following:
      INSERT INTO TABLE_Y
            (COLUMN_Y)                           --Column Y is a NUMBER type
      SELECT TO_NUMBER(COLUMN_X)    --Column X is a VARCHAR type
      FROM TABLE_X
      Thanking you in advance