I have a package similar to this simplified example:
create or replace package test is
PROCEDURE recon_2;
PROCEDURE recon_3;
PROCEDURE recon_4;
end test;
create or replace package body test is
PROCEDURE recon_1
(fiid iforce_riadmin.transactions.fi_src_sys_cd%TYPE)
IS
BEGIN
DBMS_OUTPUT.PUT_LINE ('COMPLETED: '||fiid);
END;
PROCEDURE recon_2 IS
BEGIN
recon_1 ('wach');
END;
PROCEDURE recon_3 IS
CURSOR c_fiid IS
SELECT distinct 'wach'
FROM iforce_riadmin.transactions;
BEGIN
FOR fiid in c_fiid LOOP
recon_1 (fiid); --<<-- PLS-00306 error
END LOOP;
END;
PROCEDURE recon_4 IS
CURSOR c_fiid IS
SELECT distinct 'wach'
FROM iforce_riadmin.transactions;
fiid iforce_riadmin.transactions.fi_src_sys_cd%TYPE;
BEGIN
open c_fiid;
loop
fetch c_fiid into fiid;
exit when c_fiid%notfound;
recon_1 (fiid);
end loop;
END;
end test;
PROCEDURES recon_1, 2, and 4 are compiling without a problem.
How come recon_3 does not compile and give PLS-00306 wrong number or types of arguments in call to 'RECON_1' ??