方法1:set serveroutput on size 10000000 //設置大點,默認爲2000 bytes
方法2:exec dbms_output.enable(999999999999999999999); //設置大點,默認爲2000 bytes
出現這個錯誤的原因是因爲dbms_output緩衝區的溢出。具體如下:
The DBMS_OUTPUT package enables you to send messages from stored procedures, packages, and triggers.
The PUT and PUT_LINE procedures in this package enable you to place information in a buffer that can be read by another trigger, procedure, or package. In a separate PL/SQL procedure or anonymous block, you can display the buffered information by calling the
GET_LINE procedure.
這個包提供了這個緩衝區,但是這個緩衝區大小是有限制的,像上面的兩個方法那樣設置大小,問題就可以解決。