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:29 am

I have crated a table orders having date as a one of the attribute
as follows:

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

and when I insert the value

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

it give me an error as
ORA-00932: inconsistent datatypes: expected DATE got NUMBER

no avatar
Posts: 1
Joined: Sun Mar 03, 2013 11:26 pm

Re: How to insert date in table

by gamalrashed » Sun Mar 03, 2013 11:31 pm

Your order number = 102 (3 digits) but you created the order nuber as only (2 digits), this is the reason of the error.

Return to SQL and MySQL