Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Maybe i'm making this too hard
Message
General information
Forum:
Oracle
Category:
PL/SQL
Miscellaneous
Thread ID:
00464608
Message ID:
00465038
Views:
15
If you have 8i there is a new cursor syntax called OPEN FOR.
It allows you to make dynamic SQL in a cursor.

You could code it like:

TYPE generic_rc IS REF CURSOR; (or CURSOR)
cv generic_rc;
BEGIN
OPEN cv FOR
'SELECT ' || column_list ||
' FROM ' || table_list ||
' WHERE '|| where_clause;

So you could pass in your table name, columns, where to a procedure

This sounds like what you are looking for.

I don't think this was possible on older releases. i.e. problem was you cannout use DBMS_SQL to create a cursor (but there are probably other things you can do depending on what you want the cursor for...) which is why this feature has been added.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform