You didn't reveal how exactly you call procedures from dbms_output
package so I can just guess. In fact I got same error and found a cause in my case which might be of course different than yours.
In my case I had a buffer of length 10000 (in PLSQL Developer, which is not important here) and I called only the dbms_output.put
procedure, not dbms_output.put_line
. The put
procedure keeps filling buffer and does not flush it, even if string argument contains newline character.
Compare these two attempts of writing 1001 lines of ten-characters-long string (nine visible + line terminator):
begin
dbms_output.enable(10000);
for i in 1..1001 loop
dbms_output.put('123456789' || chr(10)); -- fails here
end loop;
end;
vs.
begin
dbms_output.enable(10000);
for i in 1..1001 loop
dbms_output.put_line('123456789'); -- works
end loop;
end;
The first example fails with ORA-20000: ORU-10027: buffer overflow, limit of 10000 bytes
because it tries to put 10010 chars into buffer.
(The real story from which this minimalistic example was synthetized was printing package source code from dba_source
table. Every line of source source code in text
column is terminated by newline character which must be trimmed before sending into put_line
- without trimming it would be doubled; sending text into sole put
method would cause the buffer trouble.)