I am trying to print the output for the below sql block when it says c1_list is not a cursor. Could anyone tell me what I could be missing.
Declare
Cursor c1 is
select store_id ,geometry from TMCS.TMCS_All_Stores_TA where CLIENT_ID= 1 and rownum <1;
Type C1_TAB_TYPE is table of c1%ROWTYPE;
c1_list c1_TAB_TYPE;
-- DBMS_OUTPUT.PUT_LINE('2012 Population--> '||c1_list(1).store_id);
Begin
For r1 in c1
Loop
select store_id ,geometry
BULK COLLECT INTO c1_list from
(
select
store_id, store_number ,geometry
from TMCS.TMCS_ALL_STORES_TA
where client_id=1
and SDO_RELATE(Geometry, r1.geometry,'mask=anyinteract') = 'TRUE'
and store_id != r1.store_id
);
For r1 in c1_list
Loop
DBMS_OUTPUT.PUT_LINE('2012 Population--> '||r1.store_id);
End Loop;
End Loop;
End;