Skip to content
Advertisement

How to print the cursor values in oracle?

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:

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?

Advertisement

Answer

You can still use SYS_REFCURSOR by locating between OPEN and FOR clauses, and followed by your cursor, and then

need to add LOOP FETCH INTO... END LOOP template and Close the opened cursor after you current code :

Demo

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement