How to increase dbms_output buffer?

后端 未结 3 1464
無奈伤痛
無奈伤痛 2021-01-01 15:07

I tried to debug my dynamic query via dbms_output but seems like the query string is too long for dbms_output buffer.

I got :



        
3条回答
  •  攒了一身酷
    2021-01-01 15:45

    When buffer size gets full. There are several options you can try:

    1) Increase the size of the DBMS_OUTPUT buffer to 1,000,000

    2) Try filtering the data written to the buffer - possibly there is a loop that writes to DBMS_OUTPUT and you do not need this data.

    3) Call ENABLE at various checkpoints within your code. Each call will clear the buffer.

    DBMS_OUTPUT.ENABLE(NULL) will default to 20000 for backwards compatibility Oracle documentation on dbms_output

    You can also create your custom output display.something like below snippets

    create or replace procedure cust_output(input_string in varchar2 )
    is 
    
       out_string_in long default in_string; 
       string_lenth number; 
       loop_count number default 0; 
    
    begin 
    
       str_len := length(out_string_in);
    
       while loop_count < str_len
       loop 
          dbms_output.put_line( substr( out_string_in, loop_count +1, 255 ) ); 
          loop_count := loop_count +255; 
       end loop; 
    end;
    

    Link -Ref :Alternative to dbms_output.putline @ By: Alexander

提交回复
热议问题