Thanks,
zhou
Xuewei Zhou <zh...@Glue.umd.edu> wrote in article
<5mk7d6$8...@y.glue.umd.edu>...
From an other session run a small pl-sql block whihc read from dbms_pipe
and display the line by dbms_output. execute this program all times.
REM TO DEBUG.
Send to dbms_pipe.
Send to dbms_pipe
REM displayer
begin
read_pipe( time to wait 100000)
display
end ;
to run it all time.
while cat displayer.sql
do
:
done ¦ sqlplus user/password@db
Francois.
cat
CIAO Pierre
Try writing to a pipe, and have another task running that reads the pipe
and displays the message.
Wayne Linton
Shell Canada Ltd.
>This is not normal behavior.
>Send me your procedure, I'll take a look at it.
Don't bother looking at it, because the described behavior of
DBMS_OUTPUT is (unfortunately) perfectly normal. Output can not be
displayed until PL/SQL program completes (the whole program, not just
sub-block!) and returns controll to its caller (SQL*Plus for example).
There is no way to flush DBMS_OUTPUT buffer from inside of PL/SQL
program!
>
>CIAO Pierre
>
============================================================
Jurij Modic Republic of Slovenia
tel: +386 61 178 55 14 Ministry of Finance
fax: +386 61 21 45 84 Zupanciceva 3
e-mail: jurij...@mf.sigov.mail.si Ljubljana 1000
============================================================
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.
dbms_output.put_line won't print until the procedure is over.
About the fopen problem. Are you using utl_file package provided oracle
then check the parameter in the setup.
I forgot the exact parameter name but you can find out from the
parameter table by using
select name, value
from v$parameter
where name like '%file%'
You need to set that parameter as the path name in the init_ora. The
utl_file utility will read/write only from/in that directory.
Vijay Darekar
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 <sfed...@grads.fiu.edu> wrote in article
<5o25p1$2...@isis.fiu.edu>...
: dbms_output.put_line won't print until the procedure is over.
: About the fopen problem. Are you using utl_file package provided oracle
: then check the parameter in the setup.
: I forgot the exact parameter name but you can find out from the
: parameter table by using
: select name, value
: from v$parameter
: where name like '%file%'
: You need to set that parameter as the path name in the init_ora. The
: utl_file utility will read/write only from/in that directory.
Thank you, I already found that it was not set properly in init_ora (or
init.ora) and it takes a time to reset and restart. But what is
interesting about fopen, the ID and LOCATION have same position #, and
record and ID have different pos #. Any comments? Or it is just our
installation...
ARGUMENT_NAME POSITION SEQUENCE DATA_LEVEL DATA_TYPE
------------------------------ ---------- ---------- ---------- --------------
0 1 0 PL/SQL RECORD
ID 1 2 1 BINARY_INTEGER
LOCATION 1 3 0 VARCHAR2
FILENAME 2 4 0 VARCHAR2
OPEN_MODE 3 5 0 VARCHAR2
SQL>
: Vijay Darekar
--
-Sergey.