Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the SQL property of a View on the fly
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00283275
Message ID:
00283454
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform