I am creating a procedure in a package that calls a procedure in a package and sends out a cursor. The cursor coming out is a join of many tables. I need to then loop thru the cursor, however when I try to declare a variable to the cursor%rowtype I get that the cursor is not defined yet. Is there a way around this? Thanks!!
Here is some code:
cursorByPosEmpGroup tCursor;
-- role_rec cursorByPosEmpGroup%rowtype; --error here. can't set it to a specific table because it is a join of many
BEGIN
--fill in cursor from package
PKG_ROLE_POLICIES.GETROLEPOLICYBYPOSCODEGROUP(trim(posCode), trim(empGroup), cursorByPosEmpGroup);
--LOOP
--FETCH cursorByPosEmpGroup INTO role_rec;
--EXIT WHEN cursorByPosEmpGroup%NOTFOUND;
--get role_no
--roleNo := role_rec.Role_No;
--END LOOP;
end;
Here is some code:
cursorByPosEmpGroup tCursor;
-- role_rec cursorByPosEmpGroup%rowtype; --error here. can't set it to a specific table because it is a join of many
BEGIN
--fill in cursor from package
PKG_ROLE_POLICIES.GETROLEPOLICYBYPOSCODEGROUP(trim(posCode), trim(empGroup), cursorByPosEmpGroup);
--LOOP
--FETCH cursorByPosEmpGroup INTO role_rec;
--EXIT WHEN cursorByPosEmpGroup%NOTFOUND;
--get role_no
--roleNo := role_rec.Role_No;
--END LOOP;
end;