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:
00283438
Views:
17
>Wayne:
>
>SQL property is readonly. The only way I found to do it during runtime, is to drop it from the dbc and recreate it. I use the code from GENDBC to make a prg that I can pass the new SQL string.
>
>It would be nice to be able to change it on the fly, then issue requery().
>
>Charlie

Why not make it param driven where you build the text strings via form then requery()

Here is a valid view with test added so as not to screw my system

CREATE SQL VIEW "LV_MASTER2_test" ;
AS SELECT * FROM f:\pro30\custom\master2 ;
where sodate >= date()-15

Here is the split up of the above

mpar1='SELECT * FROM f:\pro30\custom\master2 ;
where sodate >= date()-15'

CREATE SQL VIEW "LV_MASTER2_test" ;
AS &mpar1

Now you can change what ever mpar1 is to fit your needs.

This is what the views SQL shows in eView :
SELECT * FROM f:\pro30\custom\master2 where sodate >= date()-15

Downside to this is the fact that the DBC will bloat!

__Stephen
Previous
Reply
Map
View

Click here to load this message in the networking platform