String longer than 4000 chars inside cursor-for loop [message #642421] |
Thu, 10 September 2015 06:59  |
 |
yepp
Messages: 4 Registered: September 2015
|
Junior Member |
|
|
Hello,
after creating a procedure that reads SQL statements out of a table and executes them, I got in trouble with longer statements, e.g. more than 6000 characters.
I reduced the code while trying to find out the reason and ended up with these few lines of code, which cause "ORA-01460 unimplemented or unreasonable conversion requested" as soon as l_sql will be longer than 4000 characters:
DECLARE
l_sql VARCHAR2(32767);
BEGIN
l_sql := rpad('X', 4001, 'X');
FOR rec IN (SELECT l_sql FROM dual)
LOOP
NULL;
END LOOP;
END;
Any idea how to avoid the error and make it work with strings longer than 4000 characters?
Thank you in advance.
[Updated on: Thu, 10 September 2015 07:14] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: String longer than 4000 chars inside cursor-for loop [message #642452 is a reply to message #642435] |
Fri, 11 September 2015 02:44   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Jay1 wrote on Thu, 10 September 2015 17:58
So,what is he referring 32k variable in plsql? where can we actually use this in plsql. I could not follow.
Means what it says - varchar2 variables in PL/SQL can be 32767. You can use them anywhere in PL/SQL apart from in SQL.
|
|
|
|