Advertisements

How to insert date in table

Postby onlysk » Thu Feb 21, 2013 3:29 am

Offline
onlysk
Posts: 2
Joined: Thu Feb 21, 2013 3:00 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

Re: How to insert date in table

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

Offline
gamalrashed
Posts: 1
Joined: Sun Mar 03, 2013 11:26 pm
Your order number = 102 (3 digits) but you created the order nuber as only (2 digits), this is the reason of the error.