Define and use Date data type
SQL> set echo on; SQL> DECLARE 2 x NUMBER; 3 v_message VARCHAR2(20); 4 v_today DATE; 5 BEGIN 6 x := 10; 7 DBMS_OUTPUT.PUT_LINE(x); 8 9 x := 2E5; 10 DBMS_OUTPUT.PUT_LINE(x); 11 12 v_message :='www.java2s.com'; 13 DBMS_OUTPUT.PUT_LINE('v_message'); 14 15 v_today :='01-JAN-00'; -- default date format DD-MON-YY 16 DBMS_OUTPUT.PUT_LINE(v_today); 17 18 v_today := SYSDATE; -- SQL function 19 DBMS_OUTPUT.PUT_LINE(v_today); 20 END; 21 / 10 200000 v_message 01-JAN-00 09-SEP-06 PL/SQL procedure successfully completed. SQL>