我正在尝试使用精确的过程签名来调用API,但不知何故,我认为不能正确识别的数字表.
API定义:
TYPE NUMLIST IS TABLE OF NUMBER INDEX BY VARCHAR2(50); PROCEDURE GETSERVICES_API ( I_DIMOBJID IN NUMBER,I_OBJECTID IN NUMBER,I_FILTER IN NUMBER,O_ERRORCODE OUT NUMBER,O_ERRORTEXT OUT VARCHAR2,O_SERVICELIST OUT NUMLIST );
我对API的要求:
DECLARE TYPE NUMLIST IS TABLE OF NUMBER INDEX BY VARCHAR2(50); lt_SERVICELIST NUMLIST; ls_errortext varchar2(100); ln_errorcode number; BEGIN PKGCOMSUPPORT_SERVICE.GETSERVICES_API(I_DIMOBJID => 6,I_OBJECTID => 5263,I_FILTER => 3,O_ERRORCODE => ln_errorcode,O_ERRORTEXT => ls_errortext,O_SERVICELIST => lt_SERVICELIST); END;
当我运行我的API调用时,我得到了:PLS-00306:调用’GETSERVICE_API时参数类型的数量错误
知道为什么吗?谢谢
您遇到PLS-00306错误的原因是NUMLIST集合类型不兼容,NUMLIST集合类型在包规范中定义,在匿名PL / sql块中定义的NUMLIST集合类型.即使这两种集合类型的定义相同,它们也是不兼容的.在您的匿名PL / sql块中,您必须声明然后将PKGCOMSUPPORT_SERVICE.NUMLIST数据类型的变量传递给GETSERVICES_API过程.
create or replace package PKG as type t_numlist is table of number index by varchar2(50); procedure SomeProc(p_var in pkg.t_numlist); end; / create or replace package body PKG as procedure someproc(p_var in pkg.t_numlist) is begin null; end; end; / declare type t_numlist is table of number index by varchar2(50); l_var t_numlist; begin pkg.someproc(l_var); end; ORA-06550: line 5,column 3: PLS-00306: wrong number or types of arguments in call to 'SOMEPROC' declare --type t_numlist is table of number index by varchar2(50); l_var pkg.t_numlist; begin pkg.someproc(l_var); end; anonymous block completed