-
Hi all,
I'm trying to write a select statement in a LOOP that would select from a variable instead of a table, for example:
if i have a variable called my_var contains a value 'SCHOOL_LIST' (which is a table name in the database)
how can I write a select statement so that the below would work:
Select schoolname from my_var;
(the variable is being populated via a cursor)
plse help me ..Thanks
-
look at EXECUTE IMMEDIATE to execute a dynamic sql string you create at run time, as indicated in your question.
-
Hey I would prefer to use ref cursors for that purpose..That will handle u r problem efficiently..
Vijay.s
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|