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.

Notes:<br />

Internal functions<br />

• If the scale argument is present, the result usually has the same scale as the first argument, e.g.<br />

- TRUNC(789.2225, 2) returns 789.2200 (not 789.22)<br />

- TRUNC(345.4, -2) returns 300.0 (not 300)<br />

- TRUNC(-163.41, 0) returns -163.00 (not -163)<br />

Otherwise, the result scale is 0:<br />

- TRUNC(-163.41) returns -163<br />

Important<br />

If you are used to the behaviour of the external function TRUNCATE, please notice that the internal function<br />

TRUNC always truncates toward zero, i.e. upward for negative numbers.<br />

Available in: DSQL, ESQL, PSQL<br />

Added in: IB<br />

Changed in: 2.0, <strong>2.1</strong><br />

UPPER()<br />

Description: Returns the upper-case equivalent of the input string. The exact result depends on the character<br />

set. With ASCII or NONE for instance, only ASCII characters are uppercased; with OCTETS, the entire string is<br />

returned unchanged. Since <strong>Firebird</strong> <strong>2.1</strong> this function also fully supports text BLOBs of any length and character<br />

set.<br />

Result type: (VAR)CHAR or BLOB<br />

Syntax:<br />

Examples:<br />

UPPER (str)<br />

select upper(_iso8859_1 'Débâcle')<br />

from rdb$database<br />

-- returns 'DÉBÂCLE' (before <strong>Firebird</strong> 2.0: 'DéBâCLE')<br />

select upper(_iso8859_1 'Débâcle' collate fr_fr)<br />

from rdb$database<br />

-- returns 'DEBACLE', following French uppercasing rules<br />

See also: LOWER<br />

163

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

Saved successfully!

Ooh no, something went wrong!