Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Views and multiple parameters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00036190
Message ID:
00036386
Vues:
34
>>>What is a good way of letting the user enter a few (4-7) view parameters and then requerying the view to those parameters?
>
>>Tony, instead of using a view (where the definition is stored in the DBC) why don't you just use a SQL-Select statement to populate your grid. Then you can modify the parameters with no problem. Just re-run the SELECT statement with the new clauses.
>>
>>If you are looking for a subset of your view, then you can use the view as the data source of your modified SELECT. This will cut the running time substantially.
>>
>>HTH
>>Barbara
>
>
>Thank you, that will work for me. For some reason I was under the impression that you couldn't index the output from a select statement like you can a view. But I was wrong, I just tried it using the "into cursor" option, and it worked fine! The only thing I did notice is that when you are only SELECTing one table, it does not create a temp dbf, but rather USEes AGAIN the base table, making it impossible to index. However, since I don't have this problem (my view involves several tables) then I'll worry about that later.
>
>I was able to find out why I got the "view definition has changed" error. It seems my select statement had a calculated numeric result that needed room for a full int, but was not being created in the view as a full int, but rather something like a numeric 7 precision. It looks like fox has to make a best guess when the result is a calculation, not a field which has a set data type! Unfortnately this guess was wrong, and when an int over 7 digits came through it blew up! I found that I didn't need the int, so I converted it to a string and padded it to a fixed length. I had previously PADR'd all my char calculated fields to a fixed length, but this numeric one got by me!
>
>Thanks for the help!
>tc

Glad it helped. If you're using VFP5 you can use the NOFILTER parameter in your SELECT to force a 'new' table instead of a USE AGAIN. I don't think this is available in VFP3, however. Also, you can format a numeric field in a SQL just as you can a character field.

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform