Convert number to char : Data Type Convert « PL SQL « Oracle PL / SQL






Convert number to char



SQL>
SQL> --WHILE loop
SQL>
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2   x NUMBER := 1;
  3  BEGIN
  4    WHILE x <= 5 LOOP
  5      DBMS_OUTPUT.PUT_LINE('This has executed' ||TO_CHAR(x)||' time(s)');
  6      x := x +1;
  7    END LOOP;
  8  END;
  9  /
This has executed1 time(s)
This has executed2 time(s)
This has executed3 time(s)
This has executed4 time(s)
This has executed5 time(s)

PL/SQL procedure successfully completed.

SQL>
SQL>
           
       








Related examples in the same category

1.Convert char to date: TO_DATE('January 01, 2000','Month DD, YYYY')
2.Converting number to character formatted as a numeric string
3.Convert char to number
4.Converting VARCHAR2 percentage data to a decimal equivalent
5.Convert date to char, and char to date with various formats
6.Convert char to number and number to char with various formats
7.Data implicit conversion examples: from char to number
8.Data implicit conversion examples: from char to date
9.Expressing your work in scientific notation with TO_CHAR()