Re: packages and procedures

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 4 Oct 1994 17:27:02 GMT
Message-ID: <36s396$ngc_at_dcsun4.us.oracle.com>


Very simple. You have different names for the parameters for the procedure in the header and the body. In the body, all of the parameters have v_ in front of them. So they are different procedures. The names, order, and types of all the parameters have to be the same in the package header and the body. Also whether or not the parameters are IN vs. OUT.

In article <36s1gf$ns0_at_access4.digex.net>, dsticc_at_access4.digex.net (DSTI Crystal City Office) writes:
|> Oracle folks,
|> I'm a veritable newbee to Oracle, and I have written some procedures in
|> packages for use in Oracle, and by SQL embedded in a C application. My
|> platform is VMS with Oracle 7.0. I've been able to "compile" one of the
|> packages, both spec and body, without any problem. However the second
|> package was much longer, and the system keeps telling me that I've
|> declared a procedure in the spec (which compiles o.k.) but have not defined
|> it in the body. I've checked the 16 lineal feet of Oracle documentation,
|> without finding a solution, and am about to call Oracle a second time.
|> Heres the beginning of the successfull spec for the problem package:
|>
|> /* */
|> /* spec for suite implementing field validation of the EFTS */
|> /* Usage Document Master */
|> /* */
|> /* DSTI: vAc 04 Oct. 94 */
|> /* */
|>
|> CREATE OR REPLACE PACKAGE STRIPES.VALIDATION_SUITE_PACKAGE AS
|>
|> PROCEDURE VALIDATION_SUITE(DOC_UIC IN VARCHAR2,
|> DOC_FY IN VARCHAR2,
|> DOC_SERIAL_NBR IN VARCHAR2,
|> DOC_SPIIN IN VARCHAR2,
|> DOC_REVISION IN VARCHAR2,
|> DOC_ORIGIN_CODE IN VARCHAR2,
|> DOC_CATEGORY_CODE IN VARCHAR2,
|> DIV_CODE IN VARCHAR2,
|> DOC_STATUS_CODE IN VARCHAR2,
|> APPN_CODE IN VARCHAR2,
|> ORIGINAL_FILE_NBR IN VARCHAR2,
|> RECORD_NBR IN NUMBER);
|>
|> END;
|> /
|>
|> And heres the beginning of the unsuccessfull body of same:
|>
|> /* */
|> /* body for suite implementing field validation of the EFTS */
|> /* Usage Document Master */
|> /* */
|> /* DSTI: vAc 04 Oct. 94 */
|> /* */
|>
|> CREATE OR REPLACE PACKAGE BODY STRIPES.VALIDATION_SUITE_PACKAGE AS
|>
|> MESSAGE CHAR(80);
|> APF_BEGIN_FY VARCHAR2(2);
|> PD_BEGIN_FY VARCHAR2(2);
|> APP_APPN_TERM VARCHAR2(2);
|> US_ACTION_CODE VARCHAR2(1);
|> US_APPN_SVC_DSGN VARCHAR2(2);
|> APF_MAJOR_CLAIMANT VARCHAR2(2);
|> PD_MAJOR_CLAIMANT VARCHAR2(2);
|> ACT_ACTIVITY_UIC VARCHAR2(6);
|> MASTER_DOC_SERIAL_NBR VARCHAR2(7);
|> VALID_DOC_SERIAL_NBR VARCHAR2(7);
|> VALID_DOC_UIC VARCHAR2(6);
|> VALID_DOC_FY VARCHAR2(2);
|> VALID_DOC_SPIIN VARCHAR2(2);
|> VALID_DOC_REVISION VARCHAR2(2);
|> VALID_ORIGINAL_FILE_NBR VARCHAR2(2);
|> VALID_RECORD_NBR NUMBER(4);
|> MASTER_DOC_TYPE_CODE VARCHAR2(2);
|> MASTER_DOC_ORIGIN_CODE VARCHAR2(1);
|> MASTER_DOC_PARM VARCHAR2(2);
|> MASTER_REF1_UIC VARCHAR2(6);
|> MASTER_END_FY VARCHAR2(2);
|> MASTER_DOC_CATEGORY_CODE VARCHAR2(1);
|> MASTER_DOC_RFM VARCHAR2(3);
|> MASTER_REF1_FY VARCHAR2(2);
|> MASTER_BEGIN_FY VARCHAR2(2);
|> MASTER_APPN_TYPE VARCHAR2(1);
|> MASTER_REF1_SERIAL_NBR VARCHAR2(4);
|> MASTER_MAJOR_CLAIMANT VARCHAR2(2);
|> MASTER_PRIORITY_DSGN_CODE NUMBER(2);
|> MASTER_RECV_UIC VARCHAR2(6);
|> MASTER_FUNDS_EXPIRATION VARCHAR2(8);
|>
|> PROCEDURE VALIDATION_SUITE(V_DOC_UIC IN VARCHAR2,
|> V_DOC_FY IN VARCHAR2,
|> V_DOC_SERIAL_NBR IN VARCHAR2,
|> V_DOC_SPIIN IN VARCHAR2,
|> V_DOC_REVISION IN VARCHAR2,
|> V_DOC_ORIGIN_CODE IN VARCHAR2,
|> V_DOC_CATEGORY_CODE IN VARCHAR2,
|> V_DIV_CODE IN VARCHAR2,
|> V_DOC_STATUS_CODE IN VARCHAR2,
|> V_APPN_CODE IN VARCHAR2,
|> V_ORIGINAL_FILE_NBR IN VARCHAR2,
|> V_RECORD_NBR IN NUMBER) IS
|>
|> BEGIN
|>
|> SELECT A.BEGIN_FY,
|> P.BEGIN_FY,
|> R.APPN_TERM,
|> U.ACTION_CODE,
|> A.MAJOR_SVC_DSGN,
|> A.MAJOR_CLAIMANT,
|> P.MAJOR_CLAIMANT,
|> T.ACTIVITY_UIC,
|> M.DOC_SERIAL_NBR,
|> E.DOC_SERIAL_NBR,
|> E.DOC_UIC,
|> E.DOC_FY,
|>
|> etc.....
|>
|> As I've said. Oracle tells me the procedure is undefined. Any help on this
|> one will be appreciated.
|>
|> Thanks for reading this,
|>
|> Vince Calcaterra
|> DSTI Crystal City VA USA
|>
Received on Tue Oct 04 1994 - 18:27:02 CET

Original text of this message