Firebird Documentation Index → Firebird 1.5 Language Ref. Update → Miscellaneous language elements → || (string concatenator) |
Table of Contents
Available in: DSQL, ESQL, PSQL
Changed in: 1.0
Description: If the sum of the declared string lengths in a concatenation exceeded 32767 bytes, InterBase would raise an error without trying to do the actual concatenation – even though the result might very well be within that limit. In Firebird 1.0 and 1.5, the “early error” threshold is raised to 65536. Consequently, concatenations of at most two (VAR)CHARs can no longer result in these premature errors. An error will only be raised if the actual outcome exceeds 32767 bytes, or if the sum of the declared lengths exceeds 65535 bytes. The latter is only possible if three or more strings take part in the concatenation.
Examples:
The following statement will raise an error in InterBase, but not in Firebird:
select cast('abc' as varchar(30000)) || cast('def' as varchar(30000)) from rdb$databaseThe following statement will raise an (unnecessary) error in both InterBase and Firebird:
select cast('abc' as varchar(30000)) || cast('def' as varchar(30000)) || cast('ghi' as varchar(30000)) from rdb$database
Firebird 2.0 does away with these premature errors altogether.
Firebird Documentation Index → Firebird 1.5 Language Ref. Update → Miscellaneous language elements → || (string concatenator) |