Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View Parameter name
Message
De
11/10/1999 15:20:28
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00274858
Message ID:
00275104
Vues:
27
>Hello gang,
>anyone know a way of: retrieving the name of a parameter used in a local view?
>
>TIA
>
>Pete Kane

There is a DBGETPROP property for this that you can use:

?DBGETPROP("SomeView", "View","ParameterList")

But the catch is: it doesn't work. VFP doesn't fill the property in automatically, and it doesn't appear as if the property is used internally. You can use it, but for it to be effective, you have to set the view parameters into the property manually:

?DBSETPROP("SomeView", "View","ParameterList", "MyParam1, 'C'")

The other way, if you really want to do this, is to parse the SQL that creates the view for a "?". The documentation states that a question mark is required to define a parameterized view, but this is not true. IOW- the following 2 statements are equivalent:

CREATE SQL View MyView AS SELECT * FROM MyTable WHERE MyField = ?SomeVar

CREATE SQL View MyView AS SELECT * FROM MyTable WHERE MyField = SomeVar

Luckily, most of us stick to the convention of signifying a parameter with a "?", so parsing for this character and grabbing the next word would work.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform