This just infuriated me because I never ran across it before.
I have a table with a composite primary key.
One of those values, we'll call it A and the other we'll call be
So for data that looks like...
A B
1 B
2 B
3 B
4 B
A query...
Fails with a duplicate records message for several of the records. In reality my 'A' records are from 1-8 and 6 records fail.
I had never run across this issue before and I expected it to work.... Just mad that the Engine is updating the records one at a time from a Declarative programming statement.
I'm going to have to start at the end of the records in a recordset and increment them that way instead to workaround...
In this case A is used for sorting the records so when records are inserted between two records, a gap has to be created. In this case I was debugging new code that used a test case of inserting one record and this query ran but had unexpected results. Running interactively revealed the issue.
In any case, the workaround does work.
I have a table with a composite primary key.
One of those values, we'll call it A and the other we'll call be
So for data that looks like...
A B
1 B
2 B
3 B
4 B
A query...
Code:
Update SomeTable
Set SomeTable.A = SomeTable.A + 1
WHERE SomeTable.B = 'B' And A >= 2
Fails with a duplicate records message for several of the records. In reality my 'A' records are from 1-8 and 6 records fail.
I had never run across this issue before and I expected it to work.... Just mad that the Engine is updating the records one at a time from a Declarative programming statement.
I'm going to have to start at the end of the records in a recordset and increment them that way instead to workaround...
In this case A is used for sorting the records so when records are inserted between two records, a gap has to be created. In this case I was debugging new code that used a test case of inserting one record and this query ran but had unexpected results. Running interactively revealed the issue.
In any case, the workaround does work.