Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Maybe i'm making this too hard
Message
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Divers
Thread ID:
00464608
Message ID:
00465038
Vues:
14
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
Fil
Voir

Click here to load this message in the networking platform