Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateExternal functions (UDFs) → rand
Firebird Home Firebird Home Prev: piFirebird Documentation IndexUp: External functions (UDFs)Next: right

rand

Library: ib_udf

Changed in: 2.0

Better alternative: Internal function RAND()

Description: Returns a pseudo-random number. Before Firebird 2.0, this function would first seed the random number generator with the current time in seconds. Multiple rand() calls within the same second would therefore return the same value. If you want that old behaviour in Firebird 2 and up, use srand().

Result type: DOUBLE PRECISION

Syntax: 

rand ()

Declaration: 

DECLARE EXTERNAL FUNCTION rand
   RETURNS DOUBLE PRECISION BY VALUE
   ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf'
Prev: piFirebird Documentation IndexUp: External functions (UDFs)Next: right
Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateExternal functions (UDFs) → rand