Re: Simulating sequences
> I don't think the issue is with last_insert_id. The issue is with the update statement
Eh? Your Update depends on last_insert_id(id+1) returning a unique new sequence value:
UPDATE sequence SET id = LAST_INSERT_ID(id + 1) WHERE sequence_id = 'MySequenceName'
To completely rule out sequence breaks you need to populate the target table from a sequence table with transactional control of all inserts updates & deletes, and logic to fill sequence holes when they occur (eg in physical failures).
Subject
Written By
Posted
Re: Simulating sequences
July 08, 2014 08:03PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.