I'd do it the following way:
Create the
id
column, allowing null valuesIssue this query:
UPDATE mytable SET id = rownum
Alter table to add
NOT NULL
andPRIMARY KEY
for the new id columnCreate the sequence, seeding it to
MAX(id) + 1
and use it for the further inserts.
Quassnoi
2010-02-18 09:18:19