Alternative to dbms_output.putline

送分小仙女□ 提交于 2019-12-24 07:47:00

问题


I am creating a dynamic query in a procedure and now want to see it through dbms_output.putline, but my query contains more than 255 characters.

How to view the query?

What are the alternates of dbms_output.putline?


回答1:


There's a little bit of confusion going on.

In Oracle 9i dbms_output.put_line is limited to 255 characters. This restriction was removed in 10g and is similarly not present in Oracle 11g.

You have tagged your question oracle10g, which means that you're limited to 32,767 bytes, the standard PL/SQL maximum.




回答2:


try mess around something like

create or replace procedure custom_output(in_string in varchar2 )
is 

   out_string_in long default in_string; 
   str_len 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;

/


来源:https://stackoverflow.com/questions/13667564/alternative-to-dbms-output-putline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!