Question

I want to achieve this:

UPDATE MyTable SET Field1=Field1 + 1 WHERE Field2 = 1 AND Field1 = 5000

Just to explain why is that im verifying that nobody else touched the record, Field1 is a sequence number.

How to achieve this, im thinking something like. MyDb.MySchema.Table.UpdateByField1AndField2(Field1: 5000, Field2: 1, Field1: 5001). Obviously this does not work.

Was it helpful?

Solution

what about ...

MyDb.MySchema.Table.UpdateAll(Field1: 5001, Condition: MyDb.MySchema.Table.Field1==5000 && MyDb.MySchema.Table.Field2==1)

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top