Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL writing log during PL/SQL execution (oracle 10g)
PL/SQL writing log during PL/SQL execution [message #429724] Thu, 05 November 2009 08:11 Go to next message
yurkoz
Messages: 26
Registered: September 2009
Location: bronx
Junior Member
Hello
I have simple question.
I would like to write log during PL/SQL execution.
Is there any way to write log without waiting buffer flushing ,
or flush buffer by any command from inside PL/SQL

Thanks
Re: PL/SQL writing log during PL/SQL execution [message #429725 is a reply to message #429724] Thu, 05 November 2009 08:13 Go to previous messageGo to next message
pablolee
Messages: 2813
Registered: May 2007
Location: Scotland
Senior Member
Not enough detail. Please be more specific
Re: PL/SQL writing log during PL/SQL execution [message #429728 is a reply to message #429724] Thu, 05 November 2009 08:18 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If by 'write log' you mean 'dbms_output.put_line' then no.

You can create a procedure that uses an autonomous transaction to do an insert into a log table, and commit this insert without afecting the parent transaction. This will give you a log of everything that the procedure has done so far, and one of the very few acceptable uses of Autonomous Transactions.

Alternatively, you can use the DBMS_APPLICATION_INFO package to write the current process and progress into the v$session recordand use that to log the progress of the procedure.
Re: PL/SQL writing log during PL/SQL execution [message #429730 is a reply to message #429728] Thu, 05 November 2009 08:25 Go to previous messageGo to next message
yurkoz
Messages: 26
Registered: September 2009
Location: bronx
Junior Member
Thank you JRowbottom
Re: PL/SQL writing log during PL/SQL execution [message #429732 is a reply to message #429724] Thu, 05 November 2009 08:50 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can also use UTL_FILE and write into a file.

But if your concern is to follow the processing of your PL/SQL, the best is, as mentioned by JRowbottom, DBMS_APPLICATION_INFO package.

Regards
Michel
Re: PL/SQL writing log during PL/SQL execution [message #429790 is a reply to message #429724] Thu, 05 November 2009 16:30 Go to previous message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
you might to read this as well.
Kevin
Previous Topic: External table
Next Topic: Sysdate and ToDate( )
Goto Forum:
  


Current Time: Sun Sep 25 12:57:38 CDT 2016

Total time taken to generate the page: 0.08092 seconds