任何人都可以帮我在PL / SQL中执行以下程序。我收到错误
declare
TYPE c_charge_code_arra IS TABLE OF VARCHAR2(20) INDEX BY PLS_INTEGER;
myarray c_charge_code_arra;
out_val number := 12;
begin
myarray(0) := 'hg';
BRANCH_BKK.air_pkg.airinvoice_pd('01','13070410012','4610032','A','IN','bkkrp_bkk','Asia/Bangkok','56YUSEN',null,myarray,null,'B',out_val);
end;
Error at line 1
ORA-06550: line 7, column 2:
PLS-00306: wrong number or types of arguments in call to 'AIRINVOICE_PD'
ORA-06550: line 7, column 2:
PL/SQL: Statement ignored
以下是包装声明。当我尝试执行以下过程时,我得到上述错误。在此先感谢
CREATE OR REPLACE PACKAGE BRANCH_BKK.air_pkg AS
TYPE c_charge_code_arra IS TABLE OF VARCHAR2(20) INDEX BY PLS_INTEGER;
PROCEDURE airinvoice_pd (in_company IN varchar2,
in_file_no IN varchar2,
c_reference IN varchar2,
in_run_option IN varchar2,
in_invoice_type IN varchar2,
in_user IN varchar2,
c_time_zone in varchar2,
in_payor_code IN varchar2,
in_payor_reference IN varchar2,
i_charge_code IN c_charge_code_arra,
in_invoice_number IN varchar2,
in_invoice_against IN varchar2,
out_message OUT varchar2);
答案 0 :(得分:3)
问题在于你的myarray声明。您正在尝试在调用脚本中重新声明表类型,而在此时,您需要声明包规范中定义的表类型的变量:
DECLARE
myarray BRANCH_BKK.air_pkg.c_charge_code_arra;
out_val NUMBER := 12;
BEGIN
myarray (0) := 'hg';
BRANCH_BKK.air_pkg.airinvoice_pd ('01',
'13070410012',
'4610032',
'A',
'IN',
'bkkrp_bkk',
'Asia/Bangkok',
'56YUSEN',
NULL,
myarray,
NULL,
'B',
out_val
);
END;