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 »
Oracle »
Data types »
Date:
- Date
- Default Date format
- Date literal and Date keyword
- Date and Time
- Default Date Format
Related: