Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi field parameterized remote view
Message
From
16/09/1998 13:28:29
 
 
To
16/09/1998 11:57:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00137270
Message ID:
00137365
Views:
18
Cetin,

Thanks for all your help

I tried retrieving my view from view designer like how you said.
I gave two parameters:
When I tried to browse the view, it asked for the first param, I gave it. It asked me for the next param, I did not give any and hit 'OK' button.

The result set is blank. What am I doing wrong? I guess the query looked for records that match first param 'AND' second param. B'cos second is blank, it looked for all records with first param and blank second params.
My question is:
if a view has 5 params set up initalially and a user wants to search for 3, how can i make the query ignore rest two.

Thanks


>All char fields ? Think so.
>
* Remote view created as
>CREATE SQL VIEW myremote ;
>	CONNECTION myrem1 ;
>	AS SELECT * FROM mytable ;
>	WHERE mytable.id = ?lcId ;
>        and mytable.city = ?lcCity ;	
>        and mytable.state = ?lcState
>
>* Via an interface you get values for users
>* User1
>lcId    = "someid"
>lcCity  = ""
>lcState = ""
>
>* User2
>lcId    = ""
>lcCity  = "somecity"
>lcState = ""
>
>* User3
>lcId    = ""
>lcCity  = "somecity"
>lcState = "somestate"
>
>* User4
>lcId    = ""
>lcCity  = ""
>lcState = ""
>
>use mydbc!myremote alias myview
>
>*Change filter for user4 to state search
>lcId    = ""
>lcCity  = ""
>lcState = "somestate"
>requery("myview")
Cetin
>
>>Cetin,
>>
>>Sorry, I'm little bit confused with your code.
>>
>>I will give you a small example.
>>
>>1st user searches by 'id' field
>>2nd user searches by 'city'
>>3rd seaches by 'city' and 'state'
>>4th searches by nothing
>>
>>How should i parameterize the view
>>and how should I my sql look like???
>>
>>Thanks
>>
>>>>I have a remote view from Oracle. While running the program using this view, the users will have to filter records based on different search criteria. eg. One time a user can serach by id field, another time by city, another time by city and zip code etc etc. The maximum the users will use for our app is 9. How can I parametrize my view to do all these different criteria searches?. Do I have to recreate my view each time to change the search criteria? If so, if one user searched by one field and another recreates the view woth another search criteria, would'nt the first user see the changed view now??
>>>>I heard I have to SQLEXEC() to take care of this problem, but I don't know how!
>>>>
>>>>Thanks in advance.
>>>Include all in your search criteria and provide defaults for nonspecified :
>>>
* Collect criterias via a form interface
>>>m.criteria1 = "" && Would mean all for nonspecified
>>>m.criteria2 = minvaluecriteria  && For numerics,date(time)s min-max
>>>m.criteria3 = maxvaluecriteria
>>>m.criteria4 = ""
>>>..
>>>
>>>select * from mytable ;
>>> where cSearch1 = ?m.criteria1 ;
>>>  and between nSearch2 ?m.criteria2 and ?m.criteria3 ;
>>>...
cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform