Converting Numbers to Characters Formatted as a Numeric String
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>
SQL>
SQL> --
Related examples in the same category