`
cuichang
  • 浏览: 92642 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

ORA-20000: ORU-10027: buffer overflow

SQL 
阅读更多

ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes问题的解决:

方法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. 

这个包提供了这个缓冲区,但是这个缓冲区大小是有限制的,像上面的两个方法那样设置大小,问题就可以解决。

 

 

例:

--如果执行了下面这段,会报buffer overflow limit of 2000 bytes:
declare

begin
     for i in 0..1000 loop
         dbms_output.put_line('不设定的话,输入太长会报错ORA-20000: ORU-10027:');
     end loop;

end;
/
-- 不过可以自己来设定,如下:
declare
begin
     dbms_output.enable(99999999999999);
     for i in 0..1000 loop
        dbms_output.put_line('设了dbms_output.enable(99999999999999)就不报错了');
     end loop;
end;
/

分享到:
评论
1 楼 lord_is_layuping 2011-12-12  

相关推荐

Global site tag (gtag.js) - Google Analytics