Mark C. Stock schrieb:
> "Michel Cadot" <micadot{at}altern{dot}org> wrote in message
> news:4378bf23$0$2108$626a14ce_at_news.free.fr...
>
>>"Mark C. Stock" <mcstockX_at_Xenquery .com> a écrit dans le message de news:
>>xa6dnafKT6um6-XenZ2dnUVZ_sydnZ2d_at_comcast.com...
>>|
>>| "Robert Wehofer" <thalion77_at_graffiti.net> wrote in message
>>| news:c282b$43785048$d4badae4$5308_at_news.chello.at...
>>| > Hello there!
>>| >
>>| > If I call DBMS_OUT.PUT_LINE before a long process (loop), the text is
>>| > shown
>>| > after the process. Is it possible to get the text on screen
>>immediately
>>| > before the process is starting? I need some kind of flush function.
>>| >
>>| > Regards,
>>| > Robert
>>| >
>>| >
>>|
>>| not possible with DBMS_OUTPUT, since it buffers output which is
>>accessible
>>| in the current session by the calling program (i'll assume SQL*Plus, you
>>did
>>| not specify) after the calling prorgam regains controls and can issue
>>| DBMS_OUTPUT.GET_LINE calls (which SQL*Plus and other programs do
>>| automatically)
>>|
>>| to monitor status of a process while it is running, including debug
>>| messages, the messages have to be made available to another session, via
>>| such mechanisms as:
>>| -- writes to a table (with an autonomous transaction)
>>| -- writes to a file (with the UTL_FILE package)
>>| -- writes to a database pipe (with the DBMS_PIPE package)
>>| -- writes to a queue (with the DBMS_AQ package)
>>|
>>| ++ mcs
>>|
>>
>>You can also use dbms_application_info.set_client_info and query
>>v$session.
>>
>>Regards
>>Michel Cadot
>>
>>
>
>
> which is very helpful for monitoring current status (but not too helpful or
> logging message)
>
> also useful for monitoring some long-running operations: V$SESSION_LONGOPS
>
>
It depends , how you are logging. And it depends, how OUTPUT is defined.
The most straight forward way to get your message to see immediately (
for example - you have a script running in the sqlplus and output is
your console, maybe redirected to file ) - simply select your message
from dual.
SELECT 'The long running process begins...' FROM DUAL;
BEGIN
--long running process
END;
But it is rather unusual and seldom method with some disadvantages, in
most cases the Michel's suggestion will work much better.
Best regards
Maxim
Received on Mon Nov 14 2005 - 12:19:33 CST