0
我試圖打電話與在包範圍定義的表類型參數的功能,但得到的錯誤:PLS-00306:錯號碼或類型的呼叫「好玩」的論點
PLS-00306: wrong number or types of arguments in call to 'fun'.
CREATE OR REPLACE PACKAGE pkg AS
TYPE aging_sch_record_type IS
RECORD (days_delq NUMBER, eligible NUMBER, unit NUMBER, balance NUMBER);
TYPE aging_sch_table_type IS
TABLE OF aging_sch_record_type INDEX BY VARCHAR2(20);
PROCEDURE proc();
FUNCTION fun (v_aging_sch_table aging_sch_table_type,
v_days_delq NUMBER, v_eligible NUMBER) RETURN NUMBER;
END pkg;
create or replace PACKAGE BODY pkg AS
PROCEDURE proc() AS
CURSOR aging_sch_cursor IS
SELECT ...
GROUP BY ...;
v_aging_sch_row aging_sch_cursor%rowtype;
v_aging_sch_table aging_sch_table_type;
BEGIN
FOR v_aging_sch_row IN aging_sch_cursor LOOP
v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).days_delq := v_aging_sch_row.days_delq;
v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).eligible := v_aging_sch_row.eligible;
v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).unit := v_aging_sch_row.unit;
v_aging_sch_table(v_aging_sch_row.days_delq || ' ' || v_aging_sch_row.eligible).balance := v_aging_sch_row.balance;
END LOOP;
INSERT INTO t
VALUES (fun(v_aging_sch_table,0,2));
END proc;
FUNCTION fun (v_aging_sch_table aging_sch_table_type,
v_days_delq NUMBER, v_eligible NUMBER) RETURN NUMBER
AS
BEGIN
...
END fun;
END pkg;
有什麼想法是什麼問題?
謝謝。
錯誤是哪一行? – Tenzin