Data types and subtypes

<< Miscellaneous language elements | FB 2.1 Language Reference | DDL statements >>

Data types and subtypes

BIGINT data type

Added in: 1.5

Description

BIGINT is the SQL99-compliant 64-bit signed integer type. It is available in Dialect 3 only.

BIGINT numbers range from -263 .. 263-1, or -9,223,372,036,854,775,808 .. 9,223,372,036,854,775,807.

Example

 create table WholeLottaRecords (
   id bigint not null primary key,
   description varchar(32)
 )

See also:
BIGINT

BLOB data type

Text BLOB support in functions and operators

Changed in: 2.1

Description

Text BLOBs of any length and character set (including multi-byte sets) are now supported by practically every internal text function and operator. In a few cases there are limitations or bugs.

Level of support

Various enhancements

Changed in: 2.0

Description

In Firebird 2.0, several enhancements have been implemented for text BLOBs:

  • DML COLLATE clauses are now supported.
  • Equality comparisons can be performed on the full BLOB contents.
  • Character set conversions are possible when assigning a BLOB to a BLOB or a string to a BLOB.

When defining binary BLOBs, the mnemonic binary can now be used instead of the integer 0.

Examples

 select NameBlob from MyTable
   where NameBlob collate pt_br = 'João'

 create table MyPictures (
   id int not null primary key,
   title varchar(40),
   description varchar(200),
   picture blob sub_type binary
 )

See also:
BLOB
Blob filter

back to top of page

New character sets

Added in: 1.0, 1.5, 2.0, 2.1

The following table lists the character sets added in Firebird.

Table 4.1. Character sets new in Firebird
NameMax bytes/ch.LanguagesAdded in
CP943C2Japanese2.1
DOS7371Greek1.5
DOS7751Baltic1.5
DOS8581= DOS850 plus € sign1.5
DOS8621Hebrew1.5
DOS8641Arabic1.5
DOS8661Russian1.5
DOS8691Modern Greek1.5
GBK2Chinese2.1
ISO8859_21Latin-2, Central European1.0
ISO8859_31Latin-3, Southern European1.5
ISO8859_41Latin-4, Northern European1.5
ISO8859_51Cyrillic1.5
ISO8859_61Arabic1.5
ISO8859_71Greek1.5
ISO8859_81Hebrew1.5
ISO8859_91Latin-5, Turkish1.5
ISO8859_131Latin-7, Baltic Rim1.5
KOI8R1Russian2.0
KOI8U1Ukrainian2.0
TIS6201Thai2.1
UTF8 (*)4All2.0
WIN12551Hebrew1.5
WIN12561Arabic1.5
WIN12571Baltic1.5
WIN12581Vietnamese2.0

(*) In Firebird 1.5, UTF8 is an alias for UNICODE_FSS. This character set has some inherent problems. In Firebird 2, UTF8 is a character set in its own right, without the drawbacks of UNICODE_FSS.

See also:
Character sets
Default character set
SET NAMES
Firebird 2.0 Language Reference Update: Character set NONE
Firebird 2.1 Release Notes: International language support (INTL)
Firebird 2.1 Release Notes: Appendix B: International character sets
Overview of the main character sets in Firebird
Character sets and Unicode in Firebird
Convert your Firebird applications to Unicode

Character set NONE handling changed

Changed in: 1.5.1

Description

Firebird 1.5.1 has improved the way character set NONE data are moved to and from fields or variables with another character set, resulting in fewer transliteration errors. For more details, see the Note at the end of the book.

back to top of page

New collations

Added in: 1.0, 1.5, 1.5.1, 2.0

The following table lists the collations added in Firebird. The Details column is based on what has been reported in the Release Notes and other documents. This information is almost certainly incomplete; some collations with an empty Details field may still be case insensitive (ci), accent insensitive (ai) or dictionary-sorted (dic).

Please note that the default – binary – collations for new character sets are not listed here, as doing so would add no meaningful information.

Table 4.2. Collations new in Firebird
Character setCollationLanguageDetailsAdded in
CP943C:CP943C_UNICODEJapanese 2.1
GBK:GBK_UNICODEChinese 2.1
ISO8859_1:ES_ES_CI_AISpanishci, ai2.0
 FR_FR_CI_AIFrenchci, ai2.1
 PT_BR BrazilianPortugueseci, ai2.0
ISO8859_2:CS_CZCzech 1.0
 ISO_HUNHungarian 1.5
 ISO_PLKPolish 2.0
ISO8859_13:LT_LTLithuanian 1.5.1
UTF8:UCS_BASICAll 2.0
 UNICODEAlldic2.0
 UNICODE_CIAllci2.1
WIN1250:BS_BABosnian 2.0
 PXW_HUNHungarianci1.0
 WIN_CZCzechci2.0
 WIN_CZ_CI_AICzechci, ai2.0
WIN1251:WIN1251_UAUkrainian and Russian 1.5
WIN1252:WIN_PTBRBrazilian Portugueseci, ai2.0
WIN1257:WIN1257_EEEstoniandic2.0
 WIN1257_LTLithuaniandic2.0
 WIN1257_LVLatviandic2.0
KOI8R:KOI8R_RURussiandic2.0
KOI8U:KOI8U_UAUkrainiandic2.0
TIS620:TIS620_UNICODEThai 2.1

A note on the UTF8 collations: The UCS_BASIC collation sorts in Unicode code-point order: A, B, a, b, á... This is exactly the same as UTF8 with no collation specified. UCS_BASIC was added to comply with the SQL standard.
The UNICODE collation sorts using UCA (Unicode Collation Algorithm): a, A, á, b, B...
UNICODE_CI is truly case-insensitive. In a search for e.g. 'Apple', it will also find 'apple', 'APPLE' and 'aPPLe'.

back to top of page

Unicode collations for all character sets

Added in: 2.1

Firebird now comes with UNICODE collations for all the standard character sets. However, except for the ones listed in the new collations table in the previous section, these collations are not automatically available in your databases. Instead, they must be added with the CREATE COLLATION statement, like this:

 create collation ISO8859_1_UNICODE for ISO8859_1

The new Unicode collations all have the name of their character set with _UNICODE added. (The built-in Unicode collations for UTF8 are the exception to the rule.) They are defined, along with the other collations, in the manifest file fbintl.conf in Firebird's intl subdirectory.

Collations may also be registered under a user-chosen name, e.g.:

 create collation LAT_UNI for ISO8859_1 from external ('ISO8859_1_UNICODE')

See CREATE COLLATION for the full syntax.

See also:
Collate
Collation
CREATE COLLATION
Firebird 2.1 Release Notes: International language support (INTL)

back to top of page
<< Miscellaneous language elements | FB 2.1 Language Reference | DDL statements >>