Assign the string to a date variable. The conversion is implicit. : Date Type Convert « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> SET ECHO ON
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    d1    DATE;
  3    cd1   VARCHAR2(10);
  4    cd2   VARCHAR2(10);
  5    n1    NUMBER;
  6    cn1   VARCHAR2(10);
  7    cn2   VARCHAR2(10);
  8  BEGIN
  9    cd1 := '15-Nov-61';
 10
 11    d1 := cd1;
 12    DBMS_OUTPUT.PUT_LINE('CD1 = ' || cd1);
 13    DBMS_OUTPUT.PUT_LINE('d1 = ' || d1);
 14
 15  END;
 16  /
CD1 = 15-Nov-61
d1 = 15-NOV-61

PL/SQL procedure successfully completed.

SQL>
SQL>








21.11.Date Type Convert
21.11.1.Use TO_CHAR in PL/SQL
21.11.2.Assign the string to a date variable. The conversion is implicit.
21.11.3.Assign that date variable to another string
21.11.4.Explicit declaration of format mask
21.11.5.Explicit declaration of format mask in where clause
21.11.6.Determine and display years and months