Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable where clauses
Message
De
10/01/2005 16:55:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00975797
Message ID:
00975841
Vues:
18
>>>>>Hi everybody,
>>>>>
>>>>>I have a cursoradapter class and would like to parameterize the where clause.
>>>>>
>>>>>1) Can this be done?
>>>>>2) How can I do this?
>>>>>
>>>>>Thanks in advance.
>>>>
>>>>1) Yes.
>>>>2) Like parametric views. Use ?Var for a parametric variable.
>>>>
>>>>Check Thread #944961
>>>>
>>>>Cetin
>>>
>>>Hi Cetin,
>>>
>>>I was just reading this thread. But we have more complicated situation. Basically, I have a search form, and I do not know which fields user is going to fill. I am working with VFP native data, though it doesn't make a difference. So, I need to be able to costruct "where" clause on the fly in the Cursor Adapter. Do you have suggestions how can we accomplish that?
>>>
>>>Thanks again.
>>
>>Not a complex situation, doable since foxpro 1.x.
>>It doesn't make a difference if that's native or CA or SPT. Prepare your parameters like:
>>
>>... where nID between ?nMinId and ?nMaxID,;
>>dDate between ?dMin and ?dMax ....
>>
>>etc. If parameter known store it to min and max otherwise use possible min and max values.
>>
>>Cetin
>
>That's another way to approach this problem but I like the solution by Borislav. I think, we may try tomorrow to work in SelectCmd direction.

You asked for parametric not dynamic. Then consider about caching of parametric vs dynamic SQL in different backends I'd say. However you said you're using native (and I don't understand why CA then) that should do.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform