How can I get a PL/SQL procedure to output highvolumes of debugging messages?
rajendra dot jamadagni at espndot com
Oracle 7.3 and later
Whenever I needed some kind of
from a plsql procedure, I used to rely on
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
is of great help, and my solution is based aroundthis package. There are two things needed, a
accepts a message string and optionally a pipe name. It simple putsthe message on the default pipe (unless pipe name is specified explicitly).The
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
. Oracle has provided a skeleton program called‘daemon.c’ that demonstrates a pipe listener.I prefer this technique over
, 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.