Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>Is there a way to change the SQL property of a View without first dropping it from the database and recreating it. Also, in the DE you have to close then reopen tables for it to take effect. Is there a better way?
>
>Thanx,
>Charlie
Charlie... I don't know if it is better... but here it is...
1. Create your view in the DBC. Fill out all tabs except for the filter tab.
2. Use the view with NODATAONLOAD
3. Use CURSORGETPROP() to get the SQL from the view.
4. Build your WHERE on the fly in code. Add it to the SQL from the view.
5. Execute the new SQL statment into a cursor. If this is a remote view, use the connection of the view opened in step 2.
6. Save the value of the view's buffering method. And set if for optomisitc table buffering.
7. Append to the view from the cursor aquired in step 5.
8. Use SETFLDSTATE to set the cache to clean.
9. Reset the Buffer of the view to the saved value.
10. Close the temp cursor.
*************
Believe it or not, with fairly small datasets... (500 records or less) this is pretty fast.
BOb
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