Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loadsharing with several processes
Message
From
31/03/2009 04:04:54
 
 
To
30/03/2009 05:52:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01392072
Message ID:
01392294
Views:
60
>>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

Thanks Cetin
That looks really good and so easy.
I did a quick test and sure enough the result sets came through so will do some more testing.
It seems that when I run the query and get say batch No1, I cannot get that batch again which is just what's needed. Is that data set permanently partitioned on the the table so it can never be got again ?

If so could it be lifted ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform