I am new to oracle and I am learning cursors.My table City has two columns city_id,city_name.So,this is what I tried:
DECLARE
CURSOR city_list is
SELECT * from OT.City;
v_list SYS_REFCURSOR;
BEGIN
OPEN city_list FOR
v_list := city_list;
DBMS_OUTPUT.PUT_LINE(v_list.city_id);
EXIT WHEN city_list%NOTFOUND;
CLOSE city_list;
END;
/
i am trying to assign the data of cursor to the newly declared value v_list SYS_REFCURSOR;
.But the output is coming as error at v_list := city_list;
.How can I assign all the values of cursors to the another cursor directly or is there any other methods?