ABB25
ABB25

Reputation: 101

ORA-01877: string is too long for internal buffer

I'm Trying to insert a row into ORDER table with a structure as follows:

enter image description here

However when using this insert statement:

INSERT INTO "ORDER" (
    CUSTREQDATE,
    CUSTREQTIME,
    DATEPICKEDUP,
    TIMEPICKEDUP,
    ACTUALDATEDELIVERED,
    ACTUALTIMEDELIVERED,
    DELIVEREDFLAG,
    RESTAURANTID,
    CUSTOMERID,
    DRIVERID,
    CUSTADDRESSID
) VALUES (
    TO_DATE('01/08/2017', 'DD/MM/YYYY'),
    TO_DSINTERVAL('0 19:00:00'),
    NULL,
    NULL,
    NULL,
    NULL,
    'X',
    5,
    1,
    10,
    1
);

It throws me the error:

ORA-01877: string is too long for internal buffer

I know its not my Date fields because I can insert dates on my other tables successfully using the TO_DATE statement.

Could it be my TO_DSINTERVAL statement?

Upvotes: 2

Views: 6436

Answers (1)

fen1x
fen1x

Reputation: 5880

'X' that you're trying to insert probably requires more than 1 byte (depending on your encoding).

Try changing byte to char:

ALTER TABLE "ORDER"
MODIFY(DELIVEREDFLAG CHAR (1 CHAR))

Or you can just increase DELIVEREDFLAG size:

ALTER TABLE "ORDER"
MODIFY(DELIVEREDFLAG CHAR (2 BYTE))

Upvotes: 1

Related Questions