Date literal and Date keyword

You can use the DATE keyword to supply a date literal to the database. The date must use the ANSI standard date format YYYY-MM-DD:

  • YYYY is a four-digit year.
  • MM is a two-digit month from 1 to 12.
  • DD is a two-digit day.

CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
                      ENAME VARCHAR2(10),
                      HIREDATE DATE);

INSERT INTO EMP VALUES (1, 'SMITH', date '1980-12-21');

SQL> select * from emp;

     EMPNO ENAME      HIREDATE
---------- ---------- ---------
         1 SMITH      21-DEC-80

SQL>
Home »
Oracle »
Data types » 

Date:
  1. Date
  2. Default Date format
  3. Date literal and Date keyword
  4. Date and Time
  5. Default Date Format
Related: