<<<<<<< HEAD random_uuid | H2 | SQLDoc
Skip to main content

random_uuid

1. RANDOM_UUID Function

======= random_uuid | H2 Function | SQLDoc

random_uuid

1. RANDOM_UUID Function

>>>>>>> 9d19b1c8cb744c8e86d5c15b74d8b5f719ad62be

The RANDOM_UUID function in H2 database is used to generate a random UUID (Universally Unique Identifier).

2. Syntax

The syntax for the RANDOM_UUID function in H2 database is as follows:

RANDOM_UUID()

Arguments

  • None

Return

  • The RANDOM_UUID function returns a randomly generated UUID as a string.

3. Notes

  • The RANDOM_UUID function in H2 database does not accept any arguments.
  • Each invocation of the RANDOM_UUID function will generate a new and unique UUID.
  • The generated UUID follows the version 4 (random) UUID specification.

4. Examples

Here are a few examples demonstrating the usage of the RANDOM_UUID function in H2 database:

Example 1 - Generating a single random UUID:

SELECT RANDOM_UUID() AS random_uuid;

Output:

random_uuid
--------------------------------------
f47ac10b-58cc-4372-a567-0e02b2c3d479

Example 2 - Generating multiple random UUIDs in a query:

SELECT RANDOM_UUID() AS random_uuid
FROM DUAL
LIMIT 5;

Output:

random_uuid
--------------------------------------
612025b0-8b3f-4e2a-83f2-ee6a0a1dcf85
5973d4d7-2a88-40c7-85e1-fb1a707b1cf2
7e1b7e1e-882b-4e92-b2c3-64c5a1f9b8a2
4a7768ca-6d3b-4f87-9e92-4a6a8f23d8f6
c8d7e4ef-3083-4b1e-9938-d4c7e7145c74
  • None