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 package coding standard advise seeked

Re: Oracle package coding standard advise seeked

From: shakespeare <whatsin_at_xs4all.nl>
Date: Thu, 15 Nov 2007 20:58:36 +0100
Message-ID: <473ca4ef$0$242$e4fe514c@news.xs4all.nl>

"Guy" <guhar1_at_yahoo.com> schreef in bericht news:1195075143.426852.206790_at_22g2000hsm.googlegroups.com...
>I have written my first Oracle package. Older package in my company
> make use of the PRAGMA directive. I've just read that this directive
> have been replaced with function hints PARALLEL_ENABLE and
> DETERMINISTIC. But my package rely on the fact that a global variable
> contain a user+session unique list of permissions, so it is my
> understanding that these hints cannot be used in my particular case.
>
> So my question is, to make my package state of the coding art, do I
> need to do anything else than this:
>
> (code modified for public posting)
> CREATE OR REPLACE PACKAGE PI_MY_NEW_PACKAGE
> IS
> TYPE T_MyTableType IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
>
> /* Public */
> FUNCTION F_GET_USER_PERMISSIONS(...) RETURN BOOLEAN;
> FUNCTION F_PAT_HAS_..._IN_USER(... ) RETURN BOOLEAN;
> FUNCTION F_GET_USER_LIST RETURN VARCHAR2;
> FUNCTION F_GET_ALL_LIST RETURN VARCHAR2;
> FUNCTION F_USER_CAN_SEARCH_IN( ... ) RETURN BOOLEAN;
>
> /* Private */
> FUNCTION F_CREATE_USER_LIST RETURN VARCHAR2;
> FUNCTION F_CREATE_ALL_LIST RETURN VARCHAR2;
> FUNCTION F_USER_HAS_OTHERS RETURN BOOLEAN;
> PROCEDURE P_GET_USER_MAIN(... );
> PROCEDURE P_GET_WKSTN_MAIN( ... );
> PROCEDURE P_GET_USER_OTHERS(...);
> PROCEDURE P_GET_WKSTN_OTHERS( ... );
> PROCEDURE P_ADD_IN_LIST( P_CODE NUMBER );
> FUNCTION F_CODE_EXISTS_IN_LIST( P_CODE NUMBER ) RETURN BOOLEAN;
>
> END PI_MY_NEW_PACKAGE;
> /
>
> Thanks

You should not put private functions and procedures in the package specification, only in the body (or they won't be as private as you would like...). Use IN and OUT for parameters. If you mean 'no parameters' with (...) then just use FUNCTION F_GET_USER_PERMISSIONS RETURN BOOLEAN; Don't use uppercase (style).

Shakespeare Received on Thu Nov 15 2007 - 13:58:36 CST

Original text of this message

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