Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loadsharing with several processes
Message
De
30/03/2009 05:52:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/03/2009 04:52:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01392072
Message ID:
01392077
Vues:
72
>Hi
>
>Looking for a good practice to share a task across 3 machines.
>
>The same process is running on 3 separate machine and each process should get the tasks in batches of 20 items from a SQL server table, process each, and mark the record as done when completed.
>
>No duplication allowed.
>
>What's normally done to achieve this ?
>
>TIA
>John Harriss

There are multiple ways I think. One way would be to use ntile() function to divide the data into 3 partitions. ie:

machineNum = 1
text to m.lcSQL noshow
select * from
(select *,ntile(3) over(order by customerId) as batchNum from customers) allCustomers
where batchNum = ?m.machineNum
endtext

(or have a similar partition directly on table itself on SQL server).

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform