Firebird Documentation Index → Firebird 2.1 Language Ref. Update
Firebird Home Firebird Home Firebird Documentation IndexNext: Introduction

Firebird 2.1 Language Reference Update

Everything new in Firebird SQL since InterBase 6

Paul Vinkenoog et al.

9 December 2010, document version 1.0 — covers Firebird 2.1–2.1.4


Table of Contents

1. Introduction
Subject matter
Versions covered
Authorship
2. Reserved words and keywords
Added since InterBase 6
Dropped since InterBase 6
Possibly reserved in future versions
3. Miscellaneous language elements
-- (single-line comment)
Shorthand casts
CASE construct
4. Data types and subtypes
BIGINT data type
BLOB data type
New character sets
Character set NONE handling changed
New collations
5. DDL statements
COLLATION
COMMENT
DATABASE
DOMAIN
EXCEPTION
EXTERNAL FUNCTION
FILTER
INDEX
Privileges: GRANT and REVOKE
PROCEDURE
SEQUENCE or GENERATOR
TABLE
TRIGGER
VIEW
6. DML statements
DELETE
EXECUTE BLOCK
EXECUTE PROCEDURE
INSERT
MERGE
SELECT
UPDATE
UPDATE OR INSERT
7. Transaction control statements
RELEASE SAVEPOINT
ROLLBACK
SAVEPOINT
SET TRANSACTION
8. PSQL statements
BEGIN ... END blocks may be empty
BREAK
CLOSE cursor
DECLARE
EXCEPTION
EXECUTE PROCEDURE
EXECUTE STATEMENT
EXIT
FETCH cursor
FOR EXECUTE STATEMENT ... DO
FOR SELECT ... INTO ... DO
LEAVE
OPEN cursor
PLAN allowed in trigger code
UDFs callable as void functions
WHERE CURRENT OF valid again for view cursors
9. Context variables
CURRENT_CONNECTION
CURRENT_ROLE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_TRANSACTION
CURRENT_USER
DELETING
GDSCODE
INSERTING
NEW
'NOW'
OLD
ROW_COUNT
SQLCODE
UPDATING
10. Operators and predicates
NULL literals allowed as operands
|| (string concatenator)
ALL
ANY / SOME
IN
IS [NOT] DISTINCT FROM
NEXT VALUE FOR
SOME
11. Aggregate functions
LIST()
MAX()
MIN()
12. Internal functions
ABS()
ACOS()
ASCII_CHAR()
ASCII_VAL()
ASIN()
ATAN()
ATAN2()
BIN_AND()
BIN_OR()
BIN_SHL()
BIN_SHR()
BIN_XOR()
BIT_LENGTH()
CAST()
CEIL(), CEILING()
CHAR_LENGTH(), CHARACTER_LENGTH()
COALESCE()
COS()
COSH()
COT()
DATEADD()
DATEDIFF()
DECODE()
EXP()
EXTRACT()
FLOOR()
GEN_ID()
GEN_UUID()
HASH()
IIF()
LEFT()
LN()
LOG()
LOG10()
LOWER()
LPAD()
MAXVALUE()
MINVALUE()
MOD()
NULLIF()
OCTET_LENGTH()
OVERLAY()
PI()
POSITION()
POWER()
RAND()
RDB$GET_CONTEXT()
RDB$SET_CONTEXT()
REPLACE()
REVERSE()
RIGHT()
ROUND()
RPAD()
SIGN()
SIN()
SINH()
SQRT()
SUBSTRING()
TAN()
TANH()
TRIM()
TRUNC()
UPPER()
13. External functions (UDFs)
abs
acos
addDay
addHour
addMilliSecond
addMinute
addMonth
addSecond
addWeek
addYear
ascii_char
ascii_val
asin
atan
atan2
bin_and
bin_or
bin_xor
ceiling
cos
cosh
cot
dow
dpower
floor
getExactTimestamp
i64round
i64truncate
ln
log
log10
lower
lpad
ltrim
mod
*nullif
*nvl
pi
rand
right
round, i64round
rpad
rtrim
sdow
sign
sin
sinh
sqrt
srand
sright
string2blob
strlen
substr
substrlen
tan
tanh
truncate, i64truncate
A. Notes
Character set NONE data accepted “as is
Understanding the WITH LOCK clause
A note on CSTRING parameters
Passing NULL to UDFs in Firebird 2
Maximum number of indices in different Firebird versions
B. Document History
C. License notice

List of Tables

4.1. Character sets new in Firebird
4.2. Collations new in Firebird
5.1. Specific collation attributes
5.2. Maximum indexable (VAR)CHAR length
5.3. Max. indices per table, Firebird 2.0
6.1. NULLs placement in ordered columns
10.1. Comparison of [NOT] DISTINCT to “=” and “<>
12.1. Possible CASTs
12.2. Types and ranges of EXTRACT results
12.3. Context variables in the SYSTEM namespace
A.1. How TPB settings affect explicit locking
A.2. Max. indices per table in Firebird 1.0 – 2.0
Firebird Documentation IndexNext: Introduction
Firebird Documentation Index → Firebird 2.1 Language Ref. Update