Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: dbms_output.put_line not printing
Hi,
dbms_output.put_line doesn't output the lines written to the screen until the current block has completed executing. This is because dbms_output simply writes the lines of text to a PL/SQL table in the package. Set serveroutput on is a SQL*plus command that translates to a dbms_output.enable call at the beginning to set the size of the PL/SQL table and turn on the package and then after each block or DML statement SQL*plus does a dbms_output.get_lines and reads the contents of the package table into its own local variable and then prints them to the screen. So you can see the output will never appear until after the current block or DML has run.
You could do as Frank suggests and use dbms_pipe and create a daemon to wait for the messages to be sent to the pipe (If Scott Mattes is listening he has a nice oracle pipes package that he might let you have?) else simply change your dbms_output.put_line calls to utl_file.put_line calls and set up utl_file and open a file first. You can then cat the file in another session and watch it in real time. Your other option is to use a PL/SQL debugger - there is one in a number of tools such as TOAD, JDeveloper... ro you can use the raw package dbms_debug.
hth
kind regards
Pete
-- Pete Finnigan email:pete_at_petefinnigan.com Web site: http://www.petefinnigan.com - Oracle security audit specialists Book:Oracle security step-by-step Guide - see http://store.sans.org for details.Received on Tue Feb 17 2004 - 05:20:29 CST
![]() |
![]() |