How to insert date in table

Discussion on SQL and MySQL
no avatar
Posts: 2
Joined: Thu Feb 21, 2013 3:00 am

How to insert date in table

by onlysk » Thu Feb 21, 2013 3:17 am

I have created table orders with date as an attribute which will accept date here is my query for creating table

Code: Select all
 create table orders(oid number(2), dates date, customer_id number(2), amount number(4));

now i have tried to insert data as

Code: Select all
insert into orders values(102, 2009-10-08, 3, 3000)

and it is giving me error as

ORA-00932: inconsistent datatypes: expected DATE got NUMBER

Return to SQL and MySQL