Oracle throws this error when you are trying to insert >= 4000 chars into a VARCHAR2 column. When the database is set to UTF8, but your string isn't UTF8, Oracle does the conversion internally, which can expand the string severalfold, which causes it to throw this error.
Several ideas:
- Load your data using the same character set as the database, or a subset thereof. That may mean you need to convert the string inside the application. If you are getting UTF8 data from a file, then use
the IO layers to read the string as UTF8. Or you may need to set your Perl locale correctly.
- migrate the VARCHAR2 columns to CLOBs if you need to.
- Truncate the strings before loading them.
- Alter the character set for the database handle's session.