Home » SQL & PL/SQL » SQL & PL/SQL » Logging stages of procedure
Logging stages of procedure [message #226574] Sun, 25 March 2007 04:37 Go to next message
ataufique
Messages: 79
Registered: November 2006
Member
Hi.

I have written a procedure, now i want the execution to be logged like user name, machine name, start time,
In between my procedure messages like "execution completed till..." and so on.

Anyone who can guide me how this can be done..

Thanks in advance

Re: Logging stages of procedure [message #226575 is a reply to message #226574] Sun, 25 March 2007 04:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use SYS_CONTEXT function with USERENV namespace.

For instance:
SQL> exec dbms_output.put_line('machine='||sys_context('USERENV','TERMINAL'));
machine=MICHEL

For start time:
SQL> exec dbms_output.put_line('start time='||systimestamp);
start time=25/03/2007 11:44:16.046 +02:00

And so on.

Regards
Michel
Re: Logging stages of procedure [message #226727 is a reply to message #226575] Mon, 26 March 2007 05:57 Go to previous message
ataufique
Messages: 79
Registered: November 2006
Member
Thanks Michel.
Previous Topic: How to calculate cumulative counters
Next Topic: What is the difference
Goto Forum:
  


Current Time: Wed Dec 07 16:52:34 CST 2016

Total time taken to generate the page: 0.08025 seconds