security.RandomGenerator.CreateRandomNumber

Generates a 8-byte strong random number.

Syntax

security.RandomGenerator.CreateRandomNumber()
  RETURNING result BIGINT
  1. result is a random big integer.

Usage

Generates a 8-byte strong random number and returns it as a BIGINT.

The generated number can then be used for advanced cryptographic features.

This method is based on openssl, using /dev/random on Unix and CryptGenRandom() on Microsoft Windows, which are following CSPRNG specifications.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).