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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL package style question

Re: SQL package style question

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 12 Mar 2004 09:00:04 -0800
Message-ID: <2687bb95.0403120900.c86ab61@posting.google.com>


weberm_at_polaris.net (Ubiquitous) wrote in message news:<c2qd9t$3da$3_at_news.utelfla.com>...
> Is there a consensus on what order to arrange the various subportions
> in a package body? Is it better to make all declared subroutines global,
> or to keep them within their respective public procedures and functions?
> I am writing up this package body containing several public procedures
> which contain subroutines and wonder how it would impact performance if
> I made them all global (to the package) and put them at the begining of
> the package body, other than making the package body easier to read.

If by sub-routine you mean another procedure or function that is called within one of the public procedures then common routines need to be placed up front so they are global. This leaves the question of how to handle the non-public routines that are called only by one public routine.

Writing the routines as stand-alone (global) routines has the advantage that the code is immediately available for use by any publically available procedure as part of its processing.

If on the other hand the logic is unlikely to ever be used by anthing but the one processing path it was written for then including it as an internal procedure within the publically available routine has the advantage of making splitting the package up at a future point easier if necessary.

I think it is really just a style, standards call.

IMHO -- Mark D Powell -- Received on Fri Mar 12 2004 - 11:00:04 CST

Original text of this message

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