If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Unique Identifioers for Primary Keys

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-07, 10:52
djtuke djtuke is offline
Registered User
 
Join Date: Jul 2007
Posts: 1
Unique Identifioers for Primary Keys

Hi,

Anyone had success in implementing GUIDs or UUIDs (as per SQL Server and ORacle) within DB2/UDB

ideally new external function may have been implemented...

MS SQL uses newid() Oracle uses SYS_GUID() to return a valid GUID.

GENERATE_UNIQUE is not a GUID - I need a GUID/UUID for cross db brand matching and true universal, instance, machine independent uniqueness;

GENERATE_UNIQUE may not even be unique (within a transaction is not , and identifies the machine partition.)
Reply With Quote
  #2 (permalink)  
Old 07-09-07, 11:57
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The values returned by GENERATE_UNIQUE are always unique - why do you think that may not be the case?

As for the initial question, you could write your own UDF that returns a UUID value. Depending on where you want to use this UDF, you have to declare it as [NOT] DETERMINISTIC NO EXTERNAL ACTION.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On