Re: dbms_output in a PL/SQL loop

From: Tim X <timx_at_spamto.devnul.com>
Date: 19 Jan 2003 09:27:03 +1100
Message-ID: <87ptqum6vc.fsf_at_tiger.rapttech.com.au>


>>>>> "Gilles" == Gilles Mercier <gilles.mercier_at_urbanet.ch> writes:

 Gilles> Hi, I have been trying to put a dbms_outoput.put_line in a
 Gilles> PL/SQL Loop to get a "real time" print of where the loop
 Gilles> actually is working, but it seem that all the output records
 Gilles> print on the screen only when the loop is finished...

 Gilles> Does anybody know how to get a "real time advance indicator"  Gilles> for a PL/SQL loop ?

 Gilles> Thanks in advance for your help...

One way of doing this is to use the dbms_pipes package and have your procedure write to a pipe which you then read in another session.

An alternative, but one which may be affected by file I/O buffering etc is to use dbms_file and write your debugging output to a file on the server.

Your correct in your assumption about dbms_output. The output is only flushed after the procedures your running exit. In addition, you also have the added limitation of the buffer only being a maximum of 1Mb in size, plus if your procedure throws an exception which is not caught, you won't see anything at all!

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
Received on Sat Jan 18 2003 - 23:27:03 CET

Original text of this message