How to override >2499 character error in Oracle DB?

25,076

Here are some options for working around SQL*Plus line length limitations:

  1. Upgrade to 12.2(?) client. On 12.2 the client allows up to 4999 characters. Which is infuriating in a way - if Oracle finally admits that 2499 is not enough, why did they only increase the limit to 4999?
  2. Add line breaks. Split the results into multiple lines. If using Windows make sure to use both carriage return and newline - chr(13)||chr(10).
  3. Use another program. Many programs have a SQL*Plus-like option. In general I recommend not using a SQL*Plus clone. The main advantage of SQL*Plus is that it's a simple tool and works just about the same everywhere. None of the SQL*Plus clones are fully compatible and many programs will break if you run SQL*Plus scripts on a clone.
Share:
25,076
Admin
Author by

Admin

Updated on September 12, 2020

Comments

  • Admin
    Admin over 3 years

    I have a Oracle query which I'm executing through shell script and in that my query is getting exceeded the maximum length of 2499.

    I'm getting error

    SP2-0027: INPUT IS TOO LONG(> 2499 CHARACTERS) - LINE IGNORED

  • kensai
    kensai about 5 years
    4999 is useless, we have more than 20000 strings in single line.... poor Oracle client, when you open some tool UI tool it will hang.
  • em_bo
    em_bo over 2 years
    Critical note - even in the latest version of Oracle (21c), there is a limit called "SQL or PL/SQL command- line size after variable substitution" which is 3000. If your commands are constructed with variable substitution, 3000 is the limit, period.