Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007

    Unanswered: Unique Identifioers for Primary Keys


    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.)

  2. #2
    Join Date
    Jan 2007
    Jena, Germany
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts