Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : GENERATE-UUID function
 

GENERATE-UUID function

Generates a universally unique identifier (UUID), as a 16-byte RAW value.

Syntax

GENERATE-UUID

Example

The following code fragment illustrates how to use the GENERATE-UUID function:
DEFINE VARIABLE MyUUID     AS RAW       NO-UNDO.
DEFINE VARIABLE Base64UUID AS CHARACTER NO-UNDO.

ASSIGN
  MyUUID     = GENERATE-UUID
  Base64UUID = BASE64-ENCODE(MyUUID).
You can use the GENERATE-UUID function with the BASE64-ENCODE function to generate a UUID and convert it to use in a Base64 character index. You can also remove the two trailing Base64 pad characters to reduce the size of the UUID. For example:
SUBSTRING(BASE64-ENCODE(GENERATE-UUID), 1, 22)

See also

BASE64-ENCODE function, GUID function