Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to force a flush of dbms_output.put_line

Re: How to force a flush of dbms_output.put_line

From: Your Name <Your_Name_at_pt.lu>
Date: 1997/06/16
Message-ID: <01bc7a95$50c2f100$b6d79ac2@LangeFrancois>#1/1

Hi,

        The program to debug send its information throught a dbms_pipe, each line.

	instead of dbms_output.put_line ( .....)
					^
					Same
					V
		debug_to_pipe ( to_char ( ...... ) ) ;

or define more debug_to_pipe

      procedure debug_to_pipe(reason varchar2) is
      s integer;
      begin
      dbms_pipe.pack_message(reason);
       s := dbms_pipe.send_message('DEBUG');
       if s <> 0 then
       raise_application_error(-20000, 'Error:' || to_char(s) ||   '
sending on pipe');
       end if;
      end debug_to_pipe ;


	The debug_display program is a small program, it read the pipe dbms_pipe
and display the information to the screen and that all.

   procedure pipe_to_screen is

   s		       integer;
  msg	       varchar2(200);

    begin
    s := dbms_pipe.receive_message('DEBUG');     dbms_pipe.unpack_message(msg,99999999);    dbms_output.put_line ( msg ) ;
  if msg = 'QUIT'
  then

        s := 1 / 0 ;
 end if ;
   end pipe_to_screen;   

#!/bin/sh
( echo "whenever sql_error exit 0\nset serveroutput on\nspool on" while true
do
echo "begin pipe_to_screen ; end ;\n/"
done ¦ sqlplus -s /         

Regards Francois.

Sergey V. Fedorishin <sfedor01_at_grads.fiu.edu> wrote in article <5o25p1$2s7_at_isis.fiu.edu>...
> Wayne Linton (lintonw_at_cadvision.com) wrote:
> : Xuewei Zhou wrote:
> : >
> : > I notice dbms_output.put_line does not print out the lines until my
 procedure
> : > is finished. I put 100 put_line in my procedure, it doesn't print one
 by one,
> : > it prints all of them at the end. Is there a way to force it print
 right after
> : > dbms_output.put_line is called?
> : >
> : > Thanks,
> : >
> : > zhou
 

> : Try writing to a pipe, and have another task running that reads the
 pipe
> : and displays the message.
>
> It seems there is no way to flush dbms_output. It built this way. But,
> it is not clear yet how to 'display the message':
 dbms_output.put_line???!
> I was trying to use low level file I/O but couldn't open file via fopen:
> it fires invalid_path on every combination of basename and filename I've
> tryed. Any suggestion would be helpful.
>
> TIA -Sergey.
>
> : Wayne Linton
> : Shell Canada Ltd.
>
>
Received on Mon Jun 16 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US