Errors with the Format Mask : TO_Number « Conversion Functions « Oracle PL / SQL






Errors with the Format Mask

  
SQL>
SQL> DECLARE
  2       v_Convert_Number VARCHAR2(20) := '$119,252.75';
  3       v_Hold_Number NUMBER ;
  4  BEGIN
  5       v_Hold_Number := TO_Number(v_Convert_Number,'$99,999.99');
  6       DBMS_OUTPUT.PUT_LINE('The converted number is: ' || v_Hold_Number);
  7       DBMS_OUTPUT.PUT_LINE('Your commission at 6% is: ' ||
  8                            (v_Hold_Number*.06));
  9  END;
 10  /
DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 5


SQL>
SQL>
SQL> --

   
  








Related examples in the same category

1.Converting a Character to an Integer Value
2.Converting a Character Formatted as Currency to an Integer Value
3.Converting VARCHAR2 Percentage Data to a Decimal Equivalent
4.to_number('123')