Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: unique ID - globally

Re: unique ID - globally

From: S P Arif Sahari Wibowo <arifsaha_at_null.net>
Date: Sat, 19 Feb 2000 04:02:43 -0600
Message-ID: <Pine.LNX.4.10.10002190347300.26526-100000@edward.tirone.com>


On Fri, 18 Feb 2000, Thomas Kyte wrote:

>>Do you know how to make a unique ID for primary key - globally?
>A common way is to do something like:
>
>create sequence my_seq start with 1 increment by 100000;
>at site 1.
>create sequence my_seq start with 2 increment by 200000;
>at site 2.

Do you mean start with 2 increment by 100000 at site 2? Then it is the same as concatenating the counter with an ID for the site. In this case 1, 2, ... the start number become the site ID. Every ID will have the last 5 digit represent the site code.

This obviously work,but I will still have to assign that site id. It will be nicer if the site id is self-generated. :-)

>In oracle8i, release 8.1 there is a new function:
>ops$tkyte_at_8i> select sys_guid() from dual;
>It generates and returns a globally unique identifier (RAW value) made
>up of 16 bytes.

Unfortunately I use Oracle 8.0.5...

Thank you!

                                   S P Arif Sahari Wibowo
  _____  _____  _____  _____ 
 /____  /____/ /____/ /____          arifsaha_at_null.net
_____/ /      /    / _____/       http://www.arifsaha.com/


Received on Sat Feb 19 2000 - 04:02:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US