I tried to debug my dynamic query via dbms_output
but seems like the query string is too long for dbms_output
buffer.
I got :
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_OUTPUT", line 148
ORA-06512: at line 1
Any idea how to increase the buffer size ?
Here you go:
You can Enable DBMS_OUTPUT and set the buffer size. The buffer size can be between 1 and 1,000,000.
Check this
EDIT
As per the comment posted by Frank and Mat, you can also enable it with Null
buffer_size : Upper limit, in bytes, the amount of buffered information. Setting buffer_size to NULL specifies that there should be no limit. The maximum size is 1,000,000, and the minimum is 2,000 when the user specifies buffer_size (NOT NULL).
When buffer size gets full. There are several options you can try:
1) Increase the size of the DBMS_OUTPUT buffer to 1,000,000
2) Try filtering the data written to the buffer - possibly there is a loop that writes to DBMS_OUTPUT and you do not need this data.
3) Call ENABLE at various checkpoints within your code. Each call will clear the buffer.
DBMS_OUTPUT.ENABLE(NULL) will default to 20000 for backwards compatibility Oracle documentation on dbms_output
You can also create your custom output display.something like below snippets
Link -Ref :Alternative to dbms_output.putline @ By: Alexander