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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement