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: To package or not

Re: To package or not

From: Tim Belding <Tim_Belding_at_Dell.com>
Date: Fri, 18 May 2001 10:59:43 -0500
Message-ID: <9e3gti$39g$1@galaxy.us.dell.com>

Hi,

A general scheme we have found to be good:

A package for each table...in these packages group procedures/functions that logically belong to a particular table. So for table MY_TABLE you would have a package PK_MY_TABLE.

Then a package for the schema....say your schema is MY_SCHEMA then have a package PK_MY_SCHEMA. In this package put all other procedures/functions that do not logically belong to a particular table, but do logically belong to the schema.

All above packages belong to the schema owner...so then we have a package for each department/group that needs access to any procedures/functions in the schema...for instance if the development group in Department A needs to access this schema create a PK_DEPTA package...in this package there is no code only wrappers that call procedures/functions in the other packages.

This seems to be a good way not only to organize, but also a good way to control the execute grant which for business purposes may need to be given to other groups. You can look in the package for a particular group and know pretty much at a glance what all they can execute.

HTH...Tim.

Dave Fowler <d.fowler_at_smmj.com> wrote in message news:dlYM6.13445$gc1.1188999_at_newsread1.prod.itd.earthlink.net...
> Jim,
>
> I'm a firm believer in using packages and put like functions/procedures
> there (Table control, validation/business rules, LOV output cursor
 data....)
>
> The exception to the rule would a general/powerful function that you would
> want to grant execute on that outside wouldn't apply in a package for
> security reasons. It could be in a seperate package as well. Check Steve
> Feurstein's book from O'Reilly on packages for another like option.
>
> my $.02
>
> Dave Fowler
>
> Oracle DBA/Developer
>
> "Jim Poe" <jpoe_at_fulcrumit.com> wrote in message
> news:9e0vb0$585_at_dispatch.concentric.net...
> > This is general question about using packages. Should all procedures
 and
> > functions be written in packages? Is there any reason not to put them
 into
> > a package?
> >
> > Thanks
> >
> > --
> > Jim Poe (jpoe_at_fulcrumit.com)
> >
> >
>
>
Received on Fri May 18 2001 - 10:59:43 CDT

Original text of this message

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