Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the SQL property of a View on the fly
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00283275
Message ID:
00283454
Vues:
15
>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
Fil
Voir

Click here to load this message in the networking platform