Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized view for no parameter?
Message
From
18/02/2004 12:02:22
 
 
To
18/02/2004 10:06:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00877929
Message ID:
00878369
Views:
21
Hi, Chris-

>However, I think I didn't ask the question I wanted to. I guess I should have asked how to have parameters were sometimes optional. EG: So the same form or report works whether it's for selected customers or all of them.

Ah. Well, I will included a parameter in a form Init() that is the ID of, say, the customer I want to have come up on the Customers form. So, you could check if the parameter has been passed--VARTYPE(tnID)="N"--and if it is then change your DataEnvironment to use the lv_Customer view, and if it's not set the DE to use the lv_Customers view. (Just for example).

I also noticed you had another question in your original post about view parameters based on a field in another cursor:

>There's another view where the parameter is from a second table, how would I do that?

>Select * from customer inner join address on customer.addressid = address.addressid >where address.country = ?vp_country

You'd want to include the alias of the cursor for vp_country. As long as the cursor is available, and is pointing the right row, this should be fine. Otherwise the user will be prompted to enter the value for "vp_country" which is probably awkward. You can use local or private variables or form properties, too, of course.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform