Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FoxPro Select query with joins to Sql Server tables?
Message
De
12/04/2013 14:49:20
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
 
 
À
12/04/2013 14:24:40
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 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01570621
Message ID:
01570834
Vues:
43
now that needs a review by my architecture team - lets see
Select Users.email ;
	From Jobs  ;
		Join Users On Jobs.quoted_by = Users.emp_num ;
	Where ; && qty_recd <> before_qty_recd ; needs to be taken care of by Matt when producing CSV_ListOfValuesProducedLocallyIntoString
              Jobs.job_num in (&CSV_ListOfValuesProducedLocallyIntoString)
	Order By 1 ;
	Group By 1 ;
where to send my teams bill ;-)
(No Dragan, I won't send any William over, neither to the states or to shovel your snow)


>The only problem is that in the Where clause, you are still referring to fields in my local FoxPro cursor.
>
>
>Where qty_recd <> before_qty_recd 
>...
>
>
>
>
>
>>>>The alternative way is to pass local cursor to the SQL Server, e.g. something like this
>>>>text to lcInsert noshow
>>>>declare @LocalTable (field1 varchar(10), field2 int)
>>>>endtext
>>>>
>>>>select local cursor
>>>>scan
>>>>
>>>> using textmerge create insert statements for the local cursor
>>>>endscan
>>>
>>>Does that @LocalTable remain in the Sql Server database afterwards?
>>>
>>>And, what if you have multiple users doing this process at the same time? They will all be trying to use the same @LocalTable and the records would get all jumbled up.
>>>
>>For such tiny local cursors used as join filters you can locally pipe their PKs into a
server.pk IN (client.pk1, client.pk2... client.pk_max)
value_set clause to be used on the server in the where-clause.
>>
>>
Select Users.email ;
>>	From Jobs  ;
>>		Join Users On Jobs.quoted_by = Users.emp_num ;
>>	Where qty_recd <> before_qty_recd ;
>>              and Jobs.job_num in (&CSV_ListOfValuesProducedLocallyIntoString)
>>	Order By 1 ;
>>	Group By 1 ;
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform