Converting Numbers to Characters Formatted as a Numeric String : Number Type Convert « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> set serveroutput on
SQL> set echo on
SQL>
SQL> DECLARE
  2       v_Convert_Number NUMBER := 90210;
  3       v_Hold_Char VARCHAR2(21) ;
  4  BEGIN
  5       v_Hold_Char := TO_CHAR(v_Convert_Number,'0000000000');
  6       DBMS_OUTPUT.PUT_LINE('The employee ID is: ' || v_Hold_Char);
  7  END;
  8  /
The employee ID is:  0000090210

PL/SQL procedure successfully completed.

SQL>








21.17.Number Type Convert
21.17.1.Converting Numbers to Characters Formatted as a Numeric String