Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: ok, no ROWID's as ID, what should i use instead? :-)
Yes, you would use a sequence. To create it you would issue the following =
command
CREATE SEQUENCE my_table_s
START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCACHE;
To use it in an insert you would
INSERT INTO my_table VALUES(my_table_s.nextval,nextvalue);
The sequence is a construct that will automatically return a guaranteed = unique value (per sequence)
>>> Dries Verachtert <dries_at_ulyssis.org> 07/28/00 05:06AM >>>
Hello,
Thanx for all the info about ROWID's. I still got the following questions:
* In many examples, people use NUMBER(38,0) for every ID. Is there a
certain speedup to use such large ID? For example my db has a table of
winecolours with maybe 20 rows. Should i still use NUMBER(38,0) as ID
because it is faster? NUMBER(38,0) seems to use 128 bits, does a number(?,?=
)
always use that much bits maybe?
Thanx in advance,
Dries Verachtert
--=20
Author: Dries Verachtert
INET: dries_at_ulyssis.org=20
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Jul 28 2000 - 07:02:37 CDT
![]() |
![]() |