security.RandomGenerator.CreateRandomNumber

Generates an 8-byte strong random number.

Syntax

security.RandomGenerator.CreateRandomNumber()
  RETURNS BIGINT

Usage

This method generates an 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 based on the cryptographically secure pseudo-random number generator (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).