This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / Help! In Oracle 8i, how to set the primary key column increase automatically (pls provide details)? if it's 'sequence', how to apply it to a table? thanks!
-glover(noname);
2002-11-20
(#866083@0)
-
我是新手。不知道对不对,你试试吧。SELECT SEED+1
INTO vSeed
FROM AUTOKEY
WHERE TBNAME = 'yourtablename';
用insert假如纪录。
UPDATE AUTOKEY
SET SEED= vSeed
WHERE TBNAME = 'yourtablename';
-lilyba(Sunshine);
2002-11-20
{203}
(#866099@0)
-
不规范....., 应该用 sequence
-decentboy(黄金重装甲骑士);
2002-11-20
(#866124@0)
-
同意!用sequence和trigger。每次建新表都很痛苦,怀念SQL Server的Identity......
-feather(ThanksGiving);
2002-11-20
(#866142@0)
-
有什么差别?我正在用一个script加数据呢。
-lilyba(Sunshine);
2002-11-20
(#866144@0)
-
需要手工lock table, 容易影响performance
-decentboy(黄金重装甲骑士);
2002-11-20
(#866147@0)
-
1. create sequence urName INCREMENT BY 1 START WITH SomeVal NOMAXVALUE 2. SELECT urName.NEXTVAL FROM DUAL 3. insert into ur_table(ID......) value ("the sequence you just had"......)
-tongcd(zombie);
2002-11-20
(#866131@0)
-
inCREATE SEQUENCE yourseqname
START WITH yourstartnum
MAXVALUE yourmaxnum
INCREMENT BY yourincrementvalue ;
insert into yourtablename(yourkeycolum)
values(yourseqname.NEXTVAL);
-cloud2001(卷云溶月);
2002-11-20
{182}
(#866139@0)
-
X.seq.nextval cannot be used in update/insert.
Trigger is better from performance issue.
-ra_95(小人-终结期待);
2002-11-20
{89}
(#866332@0)
-
XXseq.nextval works fine in update/insert
-yuanzidan(原子弹);
2002-11-20
{39}
(#866539@0)
-
XXX
-cloud2001(卷云溶月);
2002-11-20
{656}
(#866551@0)
-
confirmed: Since 8i. u V me X.
-ra_95(小人-终结期待);
2002-11-20
(#866584@0)
-
Thank you all Oracle gurus! I'm a Java guy who is using Oracle DBA Studio on Win2k, Can you tell me how to implement all these steps? I can create a sequence, but how to do the next steps? thank you very much!!!
-glover(noname);
2002-11-20
(#866274@0)
-
tooo...easyset identity=yes, identity seed=1; identiy increment=1 when you design the column
-0canada(ocanada);
2002-11-20
{81}
(#866284@0)
-
you're talking about MS SQL Server, not Oracle 8i, right? thx any way...
-glover(noname);
2002-11-20
(#866292@0)
-
sorry, I didn't pay attention
-0canada(ocanada);
2002-11-20
(#866295@0)
-
;p
-glover(noname);
2002-11-20
(#866311@0)