Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi field parameterized remote view
Message
De
16/09/1998 11:57:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/09/1998 11:34:24
Rick Hawkins
Rose Valley Software Studio
Wallingford, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00137270
Message ID:
00137317
Vues:
21
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform