Locating Runtime Errors
Oracle Tips by
Locating a runtime error in a complex piece of code (or one that
runs through several pieces of code) is a time-consuming and grueling
task. There are two basic ways of isolating a runtime error inside a
block of code:
Ignoring exceptions—allowing errors to rise to
the highest level, and debugging based on line number and error
Using a tracepoint variable to keep track of
the object’s execution.
Each of these methods is discussed in detail in
the following sections. Keep in mind that each of these methods is an
extreme approach and that these approaches can be blended to best suit
your programming style.
The basic idea of this approach is that the line and position
values returned by Oracle are the most effective method of isolating a
problem. Consequently, the developer ignores the use of exception
handlers and expects each exception to be raised to the highest
One significant effect of this approach is that operations are
always interrupted if an error occurs while executing a stored PL/SQL
object. This error is raised to the highest possible level.
Unfortunately, this makes for a very hostile environment for users
because every error that occurs interrupts and potentially destroys
When an error occurs, the developer collects the error text from
the user and begins stepping through the object by hand. The developer
must figure out what parameter values were passed to the object and
then execute the code to reproduce and isolate the error.
This is an excerpt from the book "High Performance Oracle
Database Automation" by Jonathan Ingram and Donald K.
Burleson, Series Editor.