Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Debugging Messages 2

Debugging Messages 2

Ratings: (0)|Views: 0|Likes:
Published by Ashok Babu

More info:

Published by: Ashok Babu on Oct 08, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

09/03/2013

pdf

text

original

 
How can I get a PL/SQL procedure to output highvolumes of debugging messages?
Author's name:
 Raj Jamadagni 
 Author's Email:
rajendra dot jamadagni at espndot com
Date written:
08/20/2001
 Oracle version(s):
Oracle 7.3 and later 
Whenever I needed some kind of 
 feedback 
from a plsql procedure, I used to rely on
dbms_output
for displaying messages. This worked fine, until I realised that themessages won’t be displayed until after the code is executed completely. So I foundanother solution …Back to index of questionsOracle supplied package
dbms_pipe
is of great help, and my solution is based aroundthis package. There are two things needed, a
 stored procedure
and a
listening program.
 The
 stored procedure
accepts a message string and optionally a pipe name. It simple putsthe message on the default pipe (unless pipe name is specified explicitly).The
listening program
can be anything that can read an oracle database pipe. This program is basically a loop, that sleeps for a while, wakes up, checks the pipe for anymessages and repeats. If a message is received, it can be processed as per individualrequirements, I usually print it to
 stdout 
. Oracle has provided a skeleton program called‘daemon.c’ that demonstrates a pipe listener.I prefer this technique over 
dbms_output
, for the following reasons
This works across clients i.e. I can use this procedure to dump messages from myOracle Form, as well as server code. So this gives me a complete picture of execution.
The messages put on the pipe can be viewed instantly (actually based on pollingtime specified for the listening daemon), so
I can see messages as the executionprogresses
.
This doesn't have 1MB limits, that of dbms_output.I embedded debugging code in my applications in such a manner that it allows me to turnon/off this tracing at runtime without any modifications to my code. Note: There is some learning curve involved in this, but here is my experience, it took mefew hours to experiement and set this up, but in last 3+ years I haven’t touched the code.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->