How to fetch the rows by dynamicaly passing table name
through cursor?

Answer Posted / madhav

By using ref cursor along with reocord data type(with out
using record type we can't pass the table name dynamically)

cursor refcursor is ref cursor;---weak ref cursor
v_refcursor refcursor----cursor variable
type recordtye is record(table_record table%rowtye,.....)

begin
if not v_recordtype%isopen then
open v_recordtype for select * from emp
end if;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl sql variable?

701


What can I use instead of union in sql?

708


How to process query result in pl/sql?

773


How to convert comma separated string to array in pl/sql?

812


What is gpt format?

698






How do you change a value in sql?

738


Is hadoop a nosql?

745


what is the use of set statement in tsql? : Transact sql

740


Where do we use pl sql?

724


What is the difference between sql and isql*plus?

704


Why do we use subquery?

703


How does a covering index work?

693


What happens when a trigger is associated to a view?

675


What is the difference between mdf and ndf files?

779


What is rownum in sql?

762