Has anyone else noticed this phenomenon when dbms_output.put_lineit cannot print more than 2000 characters at a time?
Script:
set serveroutput on size 100000;
declare
big_str varchar2(2009);
begin
for i in 1..2009 loop
big_str := big_str||'x';
end loop;
dbms_output.put_line(length(big_str));
dbms_output.put_line(big_str);
end;
/
I copied and pasted the output into an editor (Notepad ++), which told me that there are only 2,000 characters, not 2009, which I think should have been pasted. This also happens with a few of my test scripts - only 2,000 characters are printed.
I have a workaround for printing as follows:
dbms_output.put_line(length(big_str));
dbms_output.put_line(substr(big_str,1,1999));
dbms_output.put_line(substr(big_str,2000));
This adds new lines to the output, making it difficult to read when the text you are working with is pre-formatted.
Has anyone else noticed this? Is this really a mistake or some obscure feature? Is there a better workaround? Is there any other information about this?
Oracle: 10.2.0.3.0, PL/SQL Developer ( Allround Automation).