Use TO_DATE to assign value to DATE type variable : Convert to Date « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> SET ECHO ON
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    age   DATE;
  3
  4  BEGIN
  5    age := TO_DATE ('12-1-2000','mm-dd-yyyy');
  6    DBMS_OUTPUT.PUT_LINE('age:');
  7    DBMS_OUTPUT.PUT_LINE(age);
  8  END;
  9  /
age:
01-DEC-00

PL/SQL procedure successfully completed.

SQL>








21.12.Convert to Date
21.12.1.Use TO_DATE to assign value to DATE type variable