Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PL SQL Error

30 views
Skip to first unread message

The Magnet

unread,
Dec 11, 2009, 1:58:53 PM12/11/09
to
This one is kind of confusing. The max length of a VARCHAR2 is
4000. So, I call a stored procedure passing is a value that is 3278
characters long, basically text. I receive an error:

SP2-0027: Input is too long (> 2499 characters)

If I code that into a variable inside some code, same thing.

Breaking it up is not really an option since it is being called some a
PHP application. But, if 4000 is the max, why is it complaining at
3000????

joel garry

unread,
Dec 11, 2009, 2:09:24 PM12/11/09
to

Documented sqlplus command line limit:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apa.htm#i635278

Note you can find stuff like this in MOS, simply by searching the
knowledge base for the error number.

Does kinda point up that you need to understand the whole tech stack -
the clue that it is sqlplus is the SP2 in the error message.

jg
--
@home.com is bogus.
http://technology.amis.nl/blog/6404/oracle-rdbms-11gr2-solving-a-sudoku-using-recursive-subquery-factoring

The Magnet

unread,
Dec 11, 2009, 2:19:40 PM12/11/09
to
On Dec 11, 1:09 pm, joel garry <joel-ga...@home.com> wrote:
> On Dec 11, 10:58 am, The Magnet <a...@unsu.com> wrote:
>
> > This one is kind of confusing.   The max length of a VARCHAR2 is
> > 4000.  So, I call a stored procedure passing is a value that is 3278
> > characters long, basically text.  I receive an error:
>
> > SP2-0027: Input is too long (> 2499 characters)
>
> > If I code that into a variable inside some code, same thing.
>
> > Breaking it up is not really an option since it is being called some a
> > PHP application.  But, if 4000 is the max, why is it complaining at
> > 3000????
>
> Documented sqlplus command line limit:http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/apa.ht...

>
> Note you can find stuff like this in MOS, simply by searching the
> knowledge base for the error number.
>
> Does kinda point up that you need to understand the whole tech stack -
> the clue that it is sqlplus is the SP2 in the error message.
>
> jg
> --
> @home.com is bogus.http://technology.amis.nl/blog/6404/oracle-rdbms-11gr2-solving-a-sudo...


Does not make sense, unless I am confusing 2 things.

I have plenty of stored procedure where say I create a dynamic query
which is like 3500 characters long and there is no problem there.

Why is this an issue? Is it because it is getting "passed" into the
stored procedure?

Malcolm Dew-Jones

unread,
Dec 11, 2009, 1:20:11 PM12/11/09
to
The Magnet (a...@unsu.com) wrote:
: This one is kind of confusing. The max length of a VARCHAR2 is

--
I would google this error, there are lots of hits on it. Note the error
is not an oracle error per-se (ORA-) but something else.

I assume that php uses some kind of interface to get to oracle, it is
possible that the maximum is something defined in that. One googlee was
using sqlplus and their line was too long for that tool (and they got that
error), so I might guess something similar for you with php.

Also, perhaps the php code is sending multiple bytes per character
(utf-8). Then the number of characters and bytes will not be the same, so
(for example, these are not your numbers) a 2000 character string will be
greater than 2000 bytes (and so not fit into a varchar2(2000).

Also max length of a VARCHAR2 is not 4000 except as a column in the
database, in pl/sql it is much longer, as just discussed in another
thread.


ddf

unread,
Dec 11, 2009, 2:27:10 PM12/11/09
to
> stored procedure?- Hide quoted text -
>
> - Show quoted text -

Yes. You're trying to pass a single line with more than 2499
characters through the SQL*Plus interface and that's not possible.
It's not the VARCHAR2 length it's complaining about, it's the line
length.


David Fitzjarrell

Tim X

unread,
Dec 11, 2009, 5:33:41 PM12/11/09
to
The Magnet <a...@unsu.com> writes:

You need to provide

* Oracle version
* the procedure being called
* test case showing calling the procedure and the error
* the character encodings being used
* The DDL for any tables involved

--
tcross (at) rapttech dot com dot au

Gerard H. Pille

unread,
Dec 12, 2009, 7:24:50 AM12/12/09
to
Tim X schreef:

> You need to provide
>
> * Oracle version
> * the procedure being called
> * test case showing calling the procedure and the error
> * the character encodings being used
> * The DDL for any tables involved
>

Did you not forget the emp-dept requirement?

0 new messages