Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from SQL cursor
Message
De
07/01/2000 17:34:26
 
 
À
07/01/2000 17:28:52
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00314771
Message ID:
00314797
Vues:
39
>*** begin quote
>SELECT ... FROM origtable WHERE condition1 ;
> UNION SELECT ... FROM origtable WHERE condition2 ;
> UNION SELECT ... FROM origtable WHERE condition3 ;
> INTO TABLE newversion
>
>This will work as long as all 3 selects are taking the same fields from the original table, making it UNION compatible.Fred
>*** end quote
>
>Is there a limit to the complexity of the union-ed selects?
>
>Select ;
> Union Select ;
> Union Select ;
> Union Select ;
> Into DBF Output
>
>To: MikeH Re: 10 SQL calls - If the above statement is possible, it actually reduces the number of calls because the Mega-select will pull everything together in one 5-part step rather than 5 separate calls.
>
>"My sympathies for whoever inherits this code" <sg>

I *think* that the limit is 9 unions for a total of 10 tables. You could then group into intermediate SELECTS/UNIONS as many as needed.
SELECT ... UNION SELECT ... INTO CURSOR set1
SELECT ... UNION SELECT ... INTO CURSOR set2
...
SELECT ... UNION SELECT ... INTO CURSOR setn

SELECT ... FROM set1 WHERE...
      UNION ... FROM set2 WHERE...
I think you get the picture.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform