Skip to Main Content

Oracle Database Discussions

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!

Trigger: inserted value too large for column

648946Jul 8 2008 — edited Jul 8 2008
Hello,
I have the "ORA-01401: inserted value too large for column" error during the insert in MyTable on the column "Description" (Varchar2 50).
The value is more than 50 char, about 230. I have developed this Trigger:


CREATE OR REPLACE TRIGGER "MyTrigger"

BEFORE INSERT ON "MyTable"

FOR EACH ROW

BEGIN

:new.Description := substr(:new.Description,1,50);

end;




It works but i have always the same error "ORA-01401: inserted value too large for column"

If modify the column lenght to 230 char, the trigger works fine and truncate the description to 50 char.

There is a way to do it without changing the length of the field ???

Is it possible to set the size of the :new.Description variable???

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2008
Added on Jul 8 2008
14 comments
965 views