in reply to DBI ORA-01461

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:

  1. 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.
  2. migrate the VARCHAR2 columns to CLOBs if you need to.
  3. Truncate the strings before loading them.
  4. Alter the character set for the database handle's session.

Replies are listed 'Best First'.
Re^2: DBI ORA-01461
by hotpelmen (Scribe) on May 12, 2010 at 18:09 UTC
    Cleverett, thank you so much for the advice. I will add another post here whenever we implement a solution.