Hello,
I understand that I can create sequences to insert values into a Table (Oracle 10g).
But the sequence number gets lost when the server reboots, which causes problems. How can the sequence be seeded to the actual value?
Something like
Create sequence sysID
increment By 1
start with (select MAX(id) from tbl1)
The other option would be to do an insert - select like
select max(id)+1 into nextId from tbl1;
insert into tbl1 (id, name) values (nextid,'some name');
But this does not guarantee that the nextID is unique, what if some one else executes this at the same millisecond?
Thanks
Start Free Trial