I have 2 procedures (A,B) in Oracle 9i. In individual, they all work fine. But I cannot make a procedure C that calls A, which in turn calls B. I put a dbms_output.put_line before C calls A, before A calls B and one in B. Somehow, only the first put_line works. What are the possible reasons why this doesn't work? Thank you,
CREATE OR REPLACE PROCEDURE C (num in number)
as
begin
for r in (select col1 from Table1)
loop
dbms_output.put_line ('Inside C');
A(r.col1);
end loop;
end;
CREATE OR REPLACE PROCEDURE A (var1 IN varchar2)
AS
v1 varchar2;
cursor c1(c_var in varchar2) is
select col1 from table2 where col2=c_var;
BEGIN
open c1(var1);
loop
fetch c1 into v1;
exit when c1%notfound;
dbms_output.put_line ('Inside A');
B(v1);
end loop;
close c1;
END;