Here's a sampleCREATE OR REPLACE PACKAGE dba_Functions_PackageAS-- ***********************************************************************-- * System *-- * *-- * Description: Package is used to store all function required by *-- * stored procedures * -- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *-- * Modifications Log: *-- * *-- * User Date Description *-- * -------- ---------- ------------------------------------------------*-- * x002548 07/17/2001 Initial Version *-- * * -- * *-- ***********************************************************************-- ********** S T A R T - G L O B A L - D E C L A R A T I O N S **********-- ***********************************************************************Function InstrCount (strValue Varchar2 ,strTarget Varchar2) RETURN NUMBER;END dba_Functions_Package;/CREATE OR REPLACE PACKAGE BODY dba_Functions_PackageAS-- *********************************************************************-- *** F U N C T I O N (InstrCount) D E C L A R A T I O N S *****-- *********************************************************************Function InstrCount (strValue IN Varchar2 ,strTarget IN Varchar2) RETURN NumberIS numOccurs Integer := 0; numReturn Number := -1; BEGIN While numReturn != 0 Loop numReturn := Instr(strValue,strTarget,1,numOccurs+1); If numReturn <> 0 Then numOccurs := numOccurs + 1; End If; End Loop While; RETURN(numOccurs); EXCEPTION WHEN OTHERS THEN RAISE;End InstrCount;END dba_Functions_Package;/
Brett8-)