title: How to INSERT a DATE?
body: <p>Hi I am new to Oracle and forgot how to enter a date. I have tried many variations and can't seem to get it, plus I have looked on the internet but can't find the correct example. My table is set up like this: hiredate DATE,  (DATE being I assume the default input, but what is the default).</p>
  
  <p>Thanks for any help.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>SQL&gt; SET LINESIZE 120
  SQL&gt; SET PAGESIZE 45
  SQL&gt; SET FEEDBACK 1
  SQL&gt; SET ECHO ON
  SQL&gt; 
  SQL&gt; DROP TABLE employee
    2  
  SQL&gt; CREAT TABLE student
  SP2-0734: unknown command beginning "CREAT TABL..." - rest of line ignored.
  SQL&gt; CREATE TABLE employee
    2  (
    3  empno    NUMBER(4)CONSTRAINT employee_empno_PK PRIMARY KEY,
    4  empname  VARCHAR(10),
    5  job      VARCHAR(10),
    6  manager  NUMBER(4),
    7  hiredate DATE,
    8  salary   NUMBER(7,2),
    9  commission NUMBER(7,2),
   10  deptno   NUMBER(2)
   11  );
  
  Table created.
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'President', NULL, 11/17/1981, 5000, NULL, 10);
  INSERT INTO employee
              *
  ERROR at line 1:
  ORA-00947: not enough values
  
  
  SQL&gt; VALUES(7839, 'President', NULL, '11/17/1978', 5000, NULL, 10);
  SP2-0734: unknown command beginning "VALUES(783..." - rest of line ignored.
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'President', NULL, '11/17/1978', 5000, NULL, 10);
  INSERT INTO employee
              *
  ERROR at line 1:
  ORA-00947: not enough values
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, 11/17/1981, 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, 11/17/1981, 5000, NULL, 10)
                                                *
  ERROR at line 2:
  ORA-00932: inconsistent datatypes: expected DATE got NUMBER
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, 19811117, 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, 19811117, 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-00932: inconsistent datatypes: expected DATE got NUMBER
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '11/17/1981', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '11/17/1981', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '1978/11/17
    3  )
    4  ;
  ERROR:
  ORA-01756: quoted string not properly terminated
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President' NULL, '1978/11/17', 5000, NULL, 10);
   VALUES(7839, 'King', 'President' NULL, '1978/11/17', 5000, NULL, 10)
                                    *
  ERROR at line 2:
  ORA-00917: missing comma
  
  Hello, I am new to MySQL and forgot how to properly INSERT at DATE when using MySQL Plus. I have tried many different variations as you will be able to see and I can't seem to figure it out. I also looked on the internet but always find examples where they make there own formats. What is the correct way to insert a date when the table was created using: hiredate
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '1981/11/17', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '1981/11/17', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01861: literal does not match format string
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '1981/17/11', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '1981/17/11', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01861: literal does not match format string
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '17/11/1981', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '17/11/1981', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '81/11/17', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '81/11/17', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01847: day of month must be between 1 and last day of month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '17/11/81', 5000, NULL, 100);
   VALUES(7839, 'King', 'President', NULL, '17/11/81', 5000, NULL, 100)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King, 'President', NULL, '11/17/1981', 5000, NULL, 10);
  ERROR:
  ORA-01756: quoted string not properly terminated
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '11/17/81', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '11/17/81', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '17/11/81', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '17/11/81', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '81/17/11', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '81/17/11', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01847: day of month must be between 1 and last day of month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '17/81/11', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '17/81/11', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '81/11/17', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '81/11/17', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01847: day of month must be between 1 and last day of month
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '1981-11-17', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '1981-11-17', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01861: literal does not match format string
  
  
  SQL&gt; INSERT INTO employee
    2   VALUES(7839, 'King', 'President', NULL, '17/11/1981', 5000, NULL, 10);
   VALUES(7839, 'King', 'President', NULL, '17/11/1981', 5000, NULL, 10)
                                           *
  ERROR at line 2:
  ORA-01843: not a valid month
  </code></pre>