Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameters on a remote view.
Message
 
 
À
10/07/2000 13:45:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00390244
Message ID:
00390386
Vues:
8
>Thanks for the response. The view designer allows me to do it very easily, but what about when running a program which needs to define its view parameters based on user selects. Specifically, to direct the query to certain tables and links between them may also vary, again based on user request.
>Otherwise, I would have to define 3 times 14 times 365 times 10 = 153K remote views with view designer and that without restricting access for specific fields.

You create a parameterized view, where the parameter is variable:

create sql view my view as select * from mytable
where field1 = ?cValue1 and/or field2 = ?nValue2 order by something

use myview nodata

* user enters search parameters

local cValue1, nValue2
cValue1 = upper(alltrim(thisform.textbox1.value))
nValue2 = thisform.textbox2.value
requery('myview')

The view query is optimized if you have an index tag on field2 and an index tag on upper(field1).

If you need more flexibility than that, then you would need to create a USER database locally when the user launches your app, then create the views on the fly as needed.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform