>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