Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
USE myview NODATA... and VFP ask for parameters???
Message
De
06/01/2000 09:06:23
 
 
À
06/01/2000 08:53:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00313345
Message ID:
00313856
Vues:
45
>>
>>I'm not sure wshat is causing the problem- I've never run into it because I have never tried to create a view with a GROUP BY clause. If your view does not need to be updatable, why not just use a plain ol' SQL query?
>
>PMFJI-
>
>I can think of two reasons:
>
>1. Wants the query to run on the back end(performance).

A view is NO different from SQL here. If it is local data, the query NEVER runs on the backend anyway. If it is remote data, SPT will accomplish the same thing as a remote view (they are internally the same thing)


>2. Doesn't want to have to grab the entire data set, only the grouped dataset(network traffic).

With VFP data, this is not an issue because you can't control it. And I never said that you can't use a parameter in an SQL Query:

lnID = 12345
SELECT * FROM MyTable WHERE SomeID = lnID INTO CURSOR MyCursor


Neither of these reasons is valid. IMO, local views are used entirely too much, sometime just for the sake of using them. I use 2 questions when deciding whether to use a local view or plain SQL:

Does the dataset need to be updatable?
Am I using this same query all over creation?

If the answer to these is no, then there is no need for a view. Even if the first is no, and the second is yes, an argument can be made for using a query in a prg (qpr) instead.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform