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.

Chapter 10<br />

Changed in: 2.0<br />

Operators and predicates<br />

NULL literals allowed as operands<br />

Description: Before <strong>Firebird</strong> 2.0, most operators and predicates did not allow NULL literals as operands. Tests<br />

or operations like “A NULL”, “B + NULL” or “NULL < ANY(...)” would be rejected by the parser. Now<br />

they are allowed almost everywhere, but please be aware of the following:<br />

The vast majority of these newly allowed expressions return NULL regardless of the state or value of<br />

the other operand, and are therefore worthless for any practicle purpose whatsoever.<br />

In particular, don't try to determine (non-)nullness of a field or variable by testing with “= NULL” or “ NULL”.<br />

Always use “IS [NOT] NULL”.<br />

Predicates: The IN, ANY/SOME and ALL predicates now also allow NULL literals where they were previously<br />

taboo. Here too, there is no practical benefit to enjoy, but the situation is a little more complicated in that<br />

predicates with NULLs do not always return a NULL result. For details, see the <strong>Firebird</strong> Null Guide, section<br />

Predicates.<br />

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

Text BLOB concatenation<br />

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

|| (string concatenator)<br />

Description: Since <strong>Firebird</strong> <strong>2.1</strong> the concatenation operator supports BLOBs of any length and any character set.<br />

If a mixture of BLOBs and non-BLOBs is involved, the result is a BLOB. If both text and binary BLOBs are<br />

involved, the result is a binary BLOB.<br />

Result type VARCHAR or BLOB<br />

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

Description: Before <strong>Firebird</strong> 2.0, the result type of string concatenations used to be CHAR(n). In <strong>Firebird</strong> 2.0<br />

this was changed to VARCHAR(n). As a result, the maximum length of a concatenation outcome became 32765<br />

117

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

Saved successfully!

Ooh no, something went wrong!