Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Too Many Subqueries
Message
 
 
To
12/10/2001 13:04:58
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00567770
Message ID:
00567774
Views:
15
There's is a limit of 10 tables per SQL Select. Take a look at Message #56131.

>Hi all,
>In a SQL SELECT command using 11 Tables I have 10 LEFT JOINS and
>1 INNER JOIN, but VFP returns a error message: TOO MANY SUBQUERIES.
>
>I'm not using Query Builder, and there arent Subqueries in the Command.
>If I use only 10 Tables it Works fine!
>
>Is there a restriction of how many Tables I can use in a SQL SELECT command
>in VFP, I searched all the documentation and havent found any mention
>that VFP handles only 10 Tables.
>
>Is there a workaround ?
>
>Thanks in Advance
>Peter
>
>The SELECT Command...
>
>
>SELECT Histmanu.*, Veiculo.placa, Veiculo.cd_cavalo,
>Veiculo.qt_km_ini,
>   Veiculo.qt_hr_ini, Veiculo.dt_atrela, Veiculo.qt_hr_acum,
>   Veiculo.qt_km_acum, Veiculo.bl_tracao, Veiculo.bl_medprop,
>   Veiculo.bl_km, Veiculo.bl_hr, Veiculo.tp_med_man,
>   Manut.nm_manut, Fornec.nm_fornec, Grupo.nm_grpserv,
>SubGrupo.nm_subgrup,
>   Filial.nm_filial, Ccusto.nm_Ccusto, Manuxrec.cd_recurso,
>Manuxrec.qt_horas, Manuxrec.vl_hora,
>   Usuario.nm_usuario, TpServ.nm_tpserv, FilAce.nm_filial as
>nm_fil_ace
>
> FROM Veiculo, Histmanu
> LEFT  JOIN Manut
>ON  Histmanu.cd_empresa = Manut.cd_empresa
>  AND Histmanu.cd_manut   = Manut.cd_manut
> LEFT JOIN Fornec
>ON  Histmanu.cd_fornec  = Fornec.cd_fornec
> LEFT JOIN Grupo
>  ON  Histmanu.cd_grpserv = Grupo.cd_grpserv
> LEFT  JOIN SubGrupo
>       ON  Histmanu.cd_subgrup = SubGrupo.cd_subgrup
> LEFT JOIN Filial
>  ON  Histmanu.cd_empresa = Filial.cd_empresa
>  AND Histmanu.cd_Filial  = Filial.cd_Filial
> LEFT JOIN Filial FilAce
>  ON  Histmanu.cd_empresa = FilAce.cd_empresa
>  AND Histmanu.cd_fil_ace = FilAce.cd_filial
> LEFT JOIN Ccusto
>  ON  Histmanu.cd_empresa = Ccusto.cd_empresa
>  AND Histmanu.cd_Ccusto  = Ccusto.cd_Ccusto
> LEFT JOIN Usuario
>  ON  Histmanu.cd_empresa = Usuario.cd_empresa
>  AND Histmanu.cd_usu_apr = Usuario.cd_usuario
> LEFT JOIN TpServ
>  ON  Histmanu.cd_empresa = TpServ.cd_empresa
>  AND Histmanu.cd_tpserv  = TpServ.cd_tpserv
> LEFT JOIN ManuxRec
>  ON  Histmanu.cd_empresa = ManuxRec.cd_empresa
>  AND Histmanu.nr_ordserv = ManuxRec.nr_ordserv
>
>WHERE Histmanu.cd_empresa = Veiculo.cd_empresa
>AND   Histmanu.cd_veiculo = Veiculo.cd_veiculo
>AND   (Histmanu.cd_empresa = 1
>AND   Histmanu.nr_ordserv  = 0
>AND   Histmanu.tp_manut = 'P')
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform