Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01840: input value not long enough for date format

504552May 3 2007 — edited May 3 2007
Hello, I have the following insert query that is producing this error:

SUBSTR(ful.order_id, 1, 2), 'Cust Pick Up', trunc(ord.sum_date)
*
ERROR at line 23:
ORA-01840: input value not long enough for date format

Here is the query:

INSERT INTO FULFILL_TYPE_SUMMARY
select
'104' retailer_id,
SUBSTR(ful.order_id, 1, 2) division,
'Cust Pick Up' fulfill_type,
trunc(ord.sum_date) sum_date,
count(*) total_orders,
sum(ful.total_price) total_amount,
sum(ful.shipping_amount) total_shipping,
sum(ful.tax_amount) total_tax
from
order_fulfillment ful,
tmp_orders_2 ord,
outlet,
outlet_group_xref x
where
ful.order_id = ord.order_id
and ful.transition_seq = ord.transition_seq
and ful.fulfill_outlet_id = outlet.outlet_id
and ful.fulfill_outlet_id = x.outlet_id
and ord.order_type = 'pickup'
group by
SUBSTR(ful.order_id, 1, 2), 'Cust Pick Up', trunc(ord.sum_date);


Here is the definition for the FULFILL_TYPE_SUMMARY table:

Name Null? Type
----------------------------------------- -------- ----------------------------
RETAILER_ID NOT NULL NUMBER
SUM_DATE NOT NULL DATE
DIVISION NOT NULL CHAR(2)
FULFILL_TYPE NOT NULL VARCHAR2(20)
TOTAL_ORDERS NUMBER
TOTAL_AMOUNT NUMBER
TOTAL_SHIPPING NUMBER
TOTAL_TAX NUMBER


Any ideas on how to correct this? Thank you very much!!!

David
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2007
Added on May 3 2007
2 comments
437 views