SYS_GUID() Function in Oracle

In Oracle Database, the SYS_GUID() function generates and returns a globally unique identifier (RAW value) made up of 16 bytes.

On most platforms, the generated identifier consists of a host identifier, a process or thread identifier of the process or thread invoking the function, and a nonrepeating value (sequence of bytes) for that process or thread.

Syntax

The syntax goes like this:

SYS_GUID()

So, although the parentheses are required, no arguments are required (or accepted).

Example

Here’s an example to demonstrate:

SELECT SYS_GUID() FROM DUAL;

Result:

CC2633E4CC3049AAE0530100007F3182

Omitting the Parentheses

Here’s what happens if we omit the parentheses:

SELECT SYS_GUID FROM DUAL;

Result:

SQL Error: ORA-00904: "SYS_GUID": invalid identifier
00904. 00000 -  "%s: invalid identifier"

Passing Arguments

Here’s what happens if we pass an argument:

SELECT SYS_GUID(1) FROM DUAL;

Result:

SQL Error: ORA-00907: missing right parenthesis
00907. 00000 -  "missing right parenthesis"