I have a PL/SQL statement that uses EXECUTE IMMEDIATE
to execute a query. However, I'm having difficulty figuring out how to even get the text of the query that's being executed. I can't use dbms_output
as the query is greater than 255 characters. Is there any way to make sqlplus echo the string that's passed in to EXECUTE IMMEDIATE
?
views:
406answers:
4
+3
A:
What version of Oracle are you using? 255 is the default line length for DBMS_OUTPUT.PUT_LINE().
Before 10g we could display 1048 characters in a single call. Since then it is 32K.
Alternatively you should consider using an IDE which supports DBMS_DEBUG. For instance, SQL Developer does so, and it is free from Oracle. Find out more.
APC
2009-11-05 17:00:10
Hmmm... I might have been looking at outdated info. I suppose that means that nothing was getting executed where I thought it was. :-/
Jason Baker
2009-11-05 17:06:51
A:
How to print large strings N characters at a time. Modify to suit your needs.
FOR i IN 0..10 LOOP
dbms_output.put_line(substr(my_very_long_string,i*100+1,100));
END LOOP;
jva
2009-11-05 19:21:03
A:
You could insert the string into a logging/temporary table and examine it.
Sathya
2009-11-06 18:54:26