Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle stored procedures vs Running from a flat .sql file

Re: Oracle stored procedures vs Running from a flat .sql file

From: Martin Doherty <martin.doherty_at_nospam.com>
Date: Tue, 07 Jan 2003 17:01:54 -0800
Message-ID: <xRKS9.16$2c1.184@news.oracle.com>


Alex Filonov wrote:

>[snip]
>
>However, in most cases you need to modify stored objects in order to
>debug.
>

That's often because the people who code the stored procedures generally do not prepare well for the inevitable debugging phase. I saw a lovely technique in a Feuerstein book where each package contained calls to a debugging procedure at strategic points in the logic. This debugging procedure (either contained within the same package or preferably centralized for use by all code) would check a package global flag and, if true, would call dbms_output.put_line with the supplied string (plus any other standard context info desired). If you are having problems with a package, you can simply fire up SQL*Plus, set the debugging flag to true, execute the procedure and analyse the output. The nice thing is that the messages contain the knowledge imprint of the original code designer, and may supply far more insight into what's going on than you or me trying to retrofit meaningful debug messages after the fact (which might still be necessary).

Considering the relative percentages of time spent writing new code vs. time later spent maintaining that code over its life, it pains me when simple defensive programming techniques are given such low priority by developers and managers in their rush to build and meet the upcoming due date.

Martin Doherty Received on Tue Jan 07 2003 - 19:01:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US