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.

    In reply to Re: DBI ORA-01461 by cleverett
    in thread DBI ORA-01461 by hotpelmen

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  5. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  6. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  7. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  8. Please read these before you post! —
  9. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  10. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  11. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  12. See Writeup Formatting Tips and other pages linked from there for more info.