Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed.Cursor within cursor.

Prabhu_7
Frequent Advisor

Help needed.Cursor within cursor.

Some problem with this procedure.
Where is the problem ?

Procedure Script attached.

Thanks

2 REPLIES
Brian Crabtree
Honored Contributor

Re: Help needed.Cursor within cursor.

You will want to open the cursor before you try to use them, and close the cursor before you try to open it again.

Also, you might want to specificly define a dynamic sql statement instead of using a second SQL cursor.

Let me know if you understand what I mean.

Thanks,

Brian
Yogeeraj_1
Honored Contributor

Re: Help needed.Cursor within cursor.

hi,
I would do as Brian said above or use a query like this:

===============================================================
for x in ( select * from users )
loop
for y in ( select table_name from user_tables)
loop
...
end loop;
for z in ( select column_name from user_tab_columns where table_name=:rec1.table_name )
loop
...
end loop;
end loop;
===============================================================

hth
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)