由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Generate Unique ID for an existing Oracle Table
相关主题
hibernate高手求助Hibernate query
Hibernate sequences questionJTable column sorting problem.
Is there any way to uniquely identify a thread?How do I make cookies expire after a set time period?(FAQ)
问一个hibernate Key Generator的问题Re: GridLayout一问
介绍个做web的framework吧!这是为什么,请帮忙
How to get all tables in a schema in Oracle 9i using its JDBC driver?Who's online--JSP?
关于Random怎么用?how to print starting from specific pos?
请教:parse CSV文件automated web article poster
相关话题的讨论汇总
话题: unique话题: column话题: oracle话题: table话题: generate
进入Java版参与讨论
1 (共1页)
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.

1 (共1页)
进入Java版参与讨论
相关主题
automated web article poster介绍个做web的framework吧!
_out.println(...) 的下划线是什么意思?How to get all tables in a schema in Oracle 9i using its JDBC driver?
Re: what's the meaning of _ before var n关于Random怎么用?
Question about tab请教:parse CSV文件
hibernate高手求助Hibernate query
Hibernate sequences questionJTable column sorting problem.
Is there any way to uniquely identify a thread?How do I make cookies expire after a set time period?(FAQ)
问一个hibernate Key Generator的问题Re: GridLayout一问
相关话题的讨论汇总
话题: unique话题: column话题: oracle话题: table话题: generate