Firebird 2.5 Language ReferenceFirebird 2.5 Language ReferenceSystem Tables → RDB$FIELDS
Firebird Firebird Prev: RDB$EXCEPTIONSFirebird 2.5 Language ReferenceUp: System TablesNext: RDB$FIELD_DIMENSIONS

RDB$FIELDS

RDB$FIELDS stores definitions of columns and domains, both system and custom. This is where the detailed data attributes are stored for all columns.

[Note] Note

The column RDB$FIELDS.RDB$FIELD_NAME links to RDB$RELATION_FIELDS.RDB$FIELD_SOURCE, not to RDB$RELATION_FIELDS.RDB$FIELD_NAME.

Column Name Data Type Description
RDB$FIELD_NAME CHAR(31) The unique name of the domain created by the user or of the domain automatically built for the table column by the system. System-created domain names start with the 'RDB$' prefix
RDB$QUERY_NAME CHAR(31) Not used
RDB$VALIDATION_BLR BLOB BLR The binary language representation (BLR) of the SQL expression specifying the check of the CHECK value in the domain
RDB$VALIDATION_SOURCE BLOB TEXT The original source text in the SQL language specifying the check of the CHECK value
RDB$COMPUTED_BLR BLOB BLR The binary language representation (BLR) of the SQL expression the database server uses for evaluation when accessing a COMPUTED BY column
RDB$COMPUTED_SOURCE BLOB TEXT The original source text of the expression that defines a COMPUTED BY column
RDB$DEFAULT_VALUE BLOB BLR The default value, if any, for the field or domain, in binary language representation (BLR)
RDB$DEFAULT_SOURCE BLOB TEXT The default value in the source code, as an SQL constant or expression
RDB$FIELD_LENGTH SMALLINT Column size in bytes. FLOAT, DATE, TIME, INTEGER occupy 4 bytes. DOUBLE PRECISION, BIGINT, TIMESTAMP and BLOB identifier occupy 8 bytes. For the CHAR and VARCHAR data types, the column stores the maximum number of bytes specified when a string domain (column) is defined
RDB$FIELD_SCALE SMALLINT The negative number that specifies the scale for DECIMAL and NUMERIC columns—the number of digits after the decimal point
RDB$FIELD_TYPE SMALLINT Data type code for the column:
7 = SMALLINT
8 = INTEGER
10 = FLOAT
12 = DATE
13 = TIME
14 = CHAR
16 = BIGINT
27 = DOUBLE PRECISION
35 = TIMESTAMP
37 = VARCHAR
261 = BLOB
Codes for DECIMAL and NUMERIC are the same as for the integer types used to store them
RDB$FIELD_SUB_TYPE SMALLINT

Specifies the subtype for the BLOB data type:

0 - untyped
1 - text
2 - BLR
3 - access control list
4 - reserved for future use
5 - encoded table metadata description
6 - for storing the details of a cross-database transaction that ends abnormally

Specifies for the CHAR data type:

0 - untyped data
1 - fixed binary data

Specifies the particular data type for the integer data types (SMALLINT, INTEGER, BIGINT) and for fixed-point numbers (NUMERIC, DECIMAL):

0 or NULL - the data type matches the value in the RDB$FIELD_TYPE field
1 - NUMERIC
2 - DECIMAL

RDB$MISSING_VALUE BLOB BLR Not used
RDB$MISSING_SOURCE BLOB TEXT Not used
RDB$DESCRIPTION BLOB TEXT Any domain (table column) comment text
RDB$SYSTEM_FLAG SMALLINT Flag: the value of 1 means the domain is automatically created by the system, the value of 0 means that the domain is defined by the user
RDB$QUERY_HEADER BLOB TEXT Not used
RDB$SEGMENT_LENGTH SMALLINT Specifies the length of the BLOB buffer in bytes for BLOB columns. Stores NULL for all other data types
RDB$EDIT_STRING VARCHAR(127) Not used
RDB$EXTERNAL_LENGTH SMALLINT The length of the column in bytes if it belongs to an external table. Always NULL for regular tables
RDB$EXTERNAL_SCALE SMALLINT The scale factor of an integer-type field in an external table; represents the power of 10 by which the integer is multiplied
RDB$EXTERNAL_TYPE SMALLINT The data type of the field as it is represented in an external table:
7 = SMALLINT
8 = INTEGER
10 = FLOAT
12 = DATE
13 = TIME
14 = CHAR
16 = BIGINT
27 = DOUBLE PRECISION
35 = TIMESTAMP
37 = VARCHAR
261 = BLOB
RDB$DIMENSIONS SMALLINT Defines the number of dimensions in an array if the column is defined as an array. Always NULL for columns that are not arrays
RDB$NULL_FLAG SMALLINT Specifies whether the column can take an empty value (the field will contain NULL) or not (the field will contain the value of 1)
RDB$CHARACTER_LENGTH SMALLINT The length of CHAR or VARCHAR columns in characters (not in bytes)
RDB$COLLATION_ID SMALLINT The identifier of the collation sequence for a character column or domain. If it is not defined, the value of the field will be 0
RDB$CHARACTER_SET_ID SMALLINT The identifier of the character set for a character column, BLOB TEXT column or domain
RDB$FIELD_PRECISION SMALLINT Specifies the total number of digits for the fixed-point numeric data type (DECIMAL and NUMERIC). The value is 0 for the integer data types, NULL is for other data types

Prev: RDB$EXCEPTIONSFirebird 2.5 Language ReferenceUp: System TablesNext: RDB$FIELD_DIMENSIONS
Firebird 2.5 Language ReferenceFirebird 2.5 Language ReferenceSystem Tables → RDB$FIELDS