I am getting PLS-00306: wrong number or types of arguments in call to test_proc when executing the below PL/SQL block
What could the reason for this?
PL/SQL block
DECLARE
v_list_type t_lines := t_lines();
outparam1 VARCHAR2(100);
p_proj_id NUMBER;
BEGIN
p_proj_id := 255;
v_list_type.EXTEND(1);
v_list_type(1) := obj_lines(131,50);
test_proc(p_proj_id => p_proj_id ,v_list_type => v_list_type, outparam1);
DBMS_OUTPUT.PUT_LINE('result '||outparam1);
END;
/
I have the types created as below:
CREATE OR REPLACE TYPE obj_lines FORCE AS OBJECT (
project_line_id NUMBER,
requested_quantity NUMBER
);
CREATE OR REPLACE TYPE t_lines AS
TABLE OF obj_lines;
PROCEDURE
CREATE OR REPLACE PROCEDURE test_proc (
p_project_id IN PROJ_MAST.project_id%TYPE,
p_upd_lines IN t_lines,
outparam1 OUT VARCHAR2
) AS
BEGIN
FOR i IN 1..p_upd_lines.count LOOP
UPDATE PROJ_LINES ln
SET
new_requested_quantity = p_upd_lines(i).requested_quantity
WHERE
ln.project_id = p_project_id
AND ln.project_line_id = p_upd_lines(i).project_line_id;
outparam1 := ‘OK’;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error: ' || sqlerrm);
END test_proc;