在plsql dev中使用dbms_output.put_line的时候报如下错误
ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes ORA-06512: at "SYS.DBMS_OUTPUT", line 32 ORA-06512: at "SYS.DBMS_OUTPUT", line 97 ORA-06512: at "SYS.DBMS_OUTPUT", line 112 ORA-06512: at line 5 |
详细日志如下:
[@more@]SQL> SQL> set serveroutput on; SQL> begin 2 for c in (select * from dba_objects) 3 loop 4 dbms_output.put_line(c.object_name); 5 end loop; 6 end; 7 / ICOL$ I_USER1 ... ... I_SNAP_REFTIME1 MLOG_REFCOL$ begin for c in (select * from dba_objects) loop dbms_output.put_line(c.object_name); end loop; end; ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes ORA-06512: at "SYS.DBMS_OUTPUT", line 32 ORA-06512: at "SYS.DBMS_OUTPUT", line 97 ORA-06512: at "SYS.DBMS_OUTPUT", line 112 ORA-06512: at line 5 SQL> |
解决方法如下:
SQL> exec dbms_output.enable(9999999999); PL/SQL procedure successfully completed SQL> SQL> begin 2 for c in (select * from dba_objects) 3 loop 4 dbms_output.put_line(c.object_name); 5 end loop; 6 end; 7 / ICOL$ I_USER1 CON$ UNDO$ ... ... WRH$_SYS_TIME_MODEL WRH$_SYS_TIME_MODEL_PK WRH$_SYS_TIME_MODEL_PK WRH$_SERVICE_WAIT_CLASS WRH$_SERVICE_WAIT_CLASS_PK WRH$_SERVICE_WAIT_CLASS_PK BIG_TABLE P_TEST PL/SQL procedure successfully completed SQL> |
--end--