Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - SELECT: 'Too many subqueries'
Message
 
 
À
18/01/2000 13:44:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00319286
Message ID:
00319576
Vues:
20
Edward,

>You may build a cursor on fly with records 'BROO','FOXB' etc and then
>select town from towns where town IN (select town from mycursor)

Yes, I know. Actually, I was thinking about two possible scenarios here:

1) Create cursors and use subquery the same way as you suggested;
2) Play with SYS(3055) function to increase complexity level.

Let's me explain the problem, why the first approach is not so straightforward.

I have an application, which should return user's selction via result in Form Unload method (where exp). It also returns JoinCondition, FieldList, etc. through memory variables. The name of this app is BTCrit.
The other app, which perform the actual SQL, called Querier. The problem is that BTCrit has it's own DS, so all cursors, defined in BTCrit, would be unvisible for Querier.
So, the first approach requeres the both applications share the same DS.
Since we're working as a team on the complex project, it should be a team's decision...

BTW, my original question was about VFP limitation in IN function? I'm just curious.


>
>>Walter,
>>
>> Recently I found another problem with SQL. In my case the Error message was 'SQL command is too complex'. I did a simple query like:
>>select town from towns where town IN ('BROO','FOXB',etc.), 32 codes.
>>Is my understanding correct, what I can not use IN function in SQLs? What the limitation of it's usage?
>>
>>TIA
>>
>>>
>>>I've encountered the same problem. It's seems to be either a BUG or an inproriate error message for a VFP limitation. The only solution I could come up with is to split up the SQL statement into 2 others.
>>>
>>>Walter,
>>>
>>>>Received the error message 'too many subqueries'. It didn't seem right to me. (Partly because I understood a subquery to be something different.)
>>>>
>>>>I did a very simple query. All INNER JOINS on one primary table. There were approximately 11 INNER JOINS to that table. I am pretty confident about my SQL SELECT statement. Just to be sure I used the query interface (builder?) to do the same thing. It build essentially the same code and the same error occurred.
>>>>
>>>>(I was hoping to be lazy and avoid writing the darn statement but here it is in crude example form...)
>>>>
>>>>SELE tbl1.*, tbl2.xyz2, tbl3.xyz3, tbl4.xyz4, tbl5.xyz5;
>>>>FROM tbl1, ;
>>>>INNER JOIN tbl2 ON tbl1.key2 = tbl2.key2;
>>>>INNER JOIN tbl3 ON tbl1.key3 = tbl3.key3;
>>>>INNER JOIN tbl4 ON tbl1.key4 = tbl4.key4;
>>>>INNER JOIN tbl5 ON tbl1.key5 = tbl5.key5
>>>>
>>>>Of course I had more INNER JOINs but all were joined on the one primary table.
>>>>
>>>>Is this a limitation of VFP? Any other pointers?
>>>>
>>>>Thanks.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform