Subject Re: [firebird-support] Re: Violation of UNIQUE KEY constraint during UPDATE
Author Milan Babuskov
Adam wrote:
> for select id from tablea order by id desc into :id do
> begin
> update tablea set id = id + 1 where id = :id;
> end
> The idea being to force the order by for the update. I do not know if
> this would work at all, but may be worth a try.

It would work, but it is more expensive: one full scan (or index walk if
you have desc index) + pk search for each record.

Milan Babuskov