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: Separate files for Package Spec and Body

Re: Separate files for Package Spec and Body

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: Sat, 11 Dec 1999 19:03:38 +0200
Message-ID: <385283EA.C319EAF4@0800-einwahl.de>


If you look into the $ORACLE_HOME/rdbms/admin directory you will find the ending .pkh for the package header and .plb for the body.

I prefer separating these into several files. It enables me to use a specification in a recursive manner. I use a package function within a view, and I use that view within the package body. So it is a must for me to first define the package spec, next the views, next the body.

Tip: If you use function-based indexes (possible in Oracle8i) prepare a separate package which is not dependant on any table, e. g. that does not use specifications like "TAB"."COL"%type. Otherwise you may encounter recursive dependencies when creating the index or modifying the package. Thomas Kyte pointed me at this mistake. You can check it by viewing USER_DEPENDENCIES.

Martin

billmil_at_my-deja.com wrote:
>
> We're new to Oracle here and trying to adopt the best practices of the
> Oracle community. Do you Oracle experts prefer to define a package
> specification and body in separate source files or have both spec and
> body in one source file?
>
> What are the pro's and con's of each approach?
>
> Finally, do you have standard file extensions for Package specs and
> bodies (i.e. .pls and .plb)? I've seen a standards but don't know
> which ones are widely followed.
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sat Dec 11 1999 - 11:03:38 CST

Original text of this message

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