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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Added in: <strong>2.1</strong><br />

Internal functions<br />

Description: Returns a hash value for the input string. This function fully supports text BLOBs of any length<br />

and character set.<br />

Result type: BIGINT<br />

Syntax:<br />

HASH (string)<br />

Available in: DSQL, PSQL<br />

Added in: 2.0<br />

IIF()<br />

Description: IIF takes three arguments. If the first evaluates to true, the second argument is returned; otherwise<br />

the third is returned.<br />

Result type: Depends on input.<br />

Syntax:<br />

Example:<br />

IIF (, ResultT, ResultF)<br />

::= A boolean expression.<br />

select iif( sex = 'M', 'Sir', 'Madam' ) from Customers<br />

IIF(Cond, Result1, Result2) is a shortcut for “CASE WHEN Cond THEN Result1 ELSE Result2 END”.<br />

You can also compare IIF to the ternary “? :” operator in C-like languages.<br />

Available in: DSQL, PSQL<br />

Added in: <strong>2.1</strong><br />

LEFT()<br />

Description: Returns the leftmost part of the argument string. The number of characters is given in the second<br />

argument.<br />

Result type: VARCHAR or BLOB<br />

Syntax:<br />

LEFT (string, length)<br />

141

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

Saved successfully!

Ooh no, something went wrong!