21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

External functions (UDFs)<br />

DECLARE EXTERNAL FUNCTION snvl<br />

VARCHAR(100) BY DESCRIPTOR, VARCHAR(100) BY DESCRIPTOR,<br />

VARCHAR(100) BY DESCRIPTOR RETURNS PARAMETER 3<br />

ENTRY_POINT 'sNvl' MODULE_NAME 'fbudf'<br />

Library: ib_udf<br />

Added in: IB<br />

Better alternative: Internal function PI()<br />

pi<br />

Description: Returns an approximation of the value of #.<br />

Result type: DOUBLE PRECISION<br />

Syntax:<br />

pi ()<br />

Declaration:<br />

DECLARE EXTERNAL FUNCTION pi<br />

RETURNS DOUBLE PRECISION BY VALUE<br />

ENTRY_POINT 'IB_UDF_pi' MODULE_NAME 'ib_udf'<br />

Library: ib_udf<br />

Changed in: 2.0<br />

Better alternative: Internal function RAND()<br />

rand<br />

Description: Returns a pseudo-random number. Before <strong>Firebird</strong> 2.0, this function would first seed the random<br />

number generator with the current time in seconds. Multiple rand() calls within the same second would therefore<br />

return the same value. If you want that old behaviour in <strong>Firebird</strong> 2 and up, use srand().<br />

Result type: DOUBLE PRECISION<br />

Syntax:<br />

rand ()<br />

Declaration:<br />

DECLARE EXTERNAL FUNCTION rand<br />

RETURNS DOUBLE PRECISION BY VALUE<br />

ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf'<br />

184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!