Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL command too complex - what should I do?
Message
 
 
À
15/12/1999 13:30:21
Bob Lucas
The WordWare Agency
Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00301958
Message ID:
00304852
Vues:
25
Hi Bob,

I finally avoided any restrictions in multilists, using cursors technique, that Ed Rauh advised me. Unfortunately, it's not so straightforward for join condition.
Let me explain the problem. We have 2 different apps:
one called BTCrit, which allow to specify criteria and another called Querier, which runs the query. It's a pity, that we have two, but it's our reality. Each of them uses private data session. Both was written by another programmer. My assignment was just populate the form in BTCrit (because my collegue hasn't spent his time on this).

Therefore, we have 2 different problems
1) Inside BTCrit make allowance to select undefined number of items - I solved this problem (thanks this forum and Ed Rauh particulary)
2) Reconstruct our select command and run it. Currently it's a macrocommand, but it's definitely not a solution, because of its limitation. Again, Ed gave as a quite simple solution here - create a program of the fly, compile and run it.
Today was our programmers meeting. Unfortunately, we hadn't enough time to discuss this sort of details. I wrote a letter to my collegues about this idea, but they didn't response yet. Right now it's not my problem, since it's not my application, but at least we have an approach in our pocket :).


>One thing I have done with multiselects is to create a temporary cursor that holds only the key values of the records selected. I join the master table of items against this temporary cursor of key values (like the inlist, but in a table). Now the user can select ANY NUMBER of items from your list. Your SQL stays the same because now you have a regular table join. This also cuts down on the size of the macro.
>
>I hate creating arbitrary limits because of programming problems, and this method solved my problem.
>
>
>>Michael,
>>
>>>>Just now I got this error message. I know why it happened, it's because I choose lot's of items in multilist, which affect on Init method one of my other controls. I think, it's VFP limitation 255 char on the macro string. So, my questions are:
>>>2) How can I resolve this situation? Do I need to calculate length of my macro string, finding space, etc. Would be a real PITA :(
>>>
>>>Could you limit the selections in the multilist? (if normal use says 3-4 choices is adequate, 15 kills your code, limit the picklist to 10 at a time)
>>>
>>>Assuming your macro is something like: Select ... Where ¯ostring,
>>>Maybe you could do: Select ... Where value1 In Select value2 where value3=.T.
>>>(value1=keyvalue, value2=picked value, value3=value2 was picked or not)
>>>
>>>Or maybe I/we don't have enough info on what you're trying to do?
>>
>>I gave a little more info in my answer to Mark. Yes, we would restrict the user's choice. Even if I don't like it, because, I'm afraid, it's an only chance. I'll also take a look into SYS(3055) as John and Ed advised, may be it would help me, but I doubt.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform