F****n 发帖数: 3271 | 1 I have a Oracle table with a unique column and a lot of existing data. I
want to insert new records. What is the best way to generate unique
identifiers for this column? sys_guid? I cannot use sequence and the unique
column has not used any auto-increment mechanism. |
B*****g 发帖数: 34098 | 2 why "I cannot use sequence"?
unique
【在 F****n 的大作中提到】 : I have a Oracle table with a unique column and a lot of existing data. I : want to insert new records. What is the best way to generate unique : identifiers for this column? sys_guid? I cannot use sequence and the unique : column has not used any auto-increment mechanism.
|
F****n 发帖数: 3271 | 3 Because it was not created by me and there are already a lot of records in
it with all kinds of numbers in that column.
【在 B*****g 的大作中提到】 : why "I cannot use sequence"? : : unique
|
B*****g 发帖数: 34098 | 4 instead of update that column to sys_guid, update that column to a sequence.
I know we all hate SQL:
update table SET column = seq.nextval
【在 F****n 的大作中提到】 : Because it was not created by me and there are already a lot of records in : it with all kinds of numbers in that column.
|
F****n 发帖数: 3271 | 5 How can I make sure that seq.nextval will not hit one of the existing
numbers in that column? Currently my workaround is to start from the max. Is
there a better practice?
sequence.
【在 B*****g 的大作中提到】 : instead of update that column to sys_guid, update that column to a sequence. : I know we all hate SQL: : update table SET column = seq.nextval
|
B*****g 发帖数: 34098 | 6 不是特大的table一般都这样做
Is
【在 F****n 的大作中提到】 : How can I make sure that seq.nextval will not hit one of the existing : numbers in that column? Currently my workaround is to start from the max. Is : there a better practice? : : sequence.
|