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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only