FirebirdSQL logo

RDB$TRIGGER_TYPE Value

The value of RDB$TRIGGER_TYPE is built from:

1

before insert

2

after insert

3

before update

4

after update

5

before delete

6

after delete

17

before insert or update

18

after insert or update

25

before insert or delete

26

after insert or delete

27

before update or delete

28

after update or delete

113

before insert or update or delete

114

after insert or update or delete

8192

on connect

8193

on disconnect

8194

on transaction start

8195

on transaction commit

8196

on transaction rollback

Note

Identification of the exact RDB$TRIGGER_TYPE code is a little more complicated, since it is a bitmap, calculated according to which phase and events are covered and the order in which they are defined.For the curious, the calculation is explained in this code comment by Mark Rotteveel.

For DDL triggers, the trigger type is obtained by bitwise OR above the event phase (0 — BEFORE, 1 — AFTER) and all listed types events:

0x0000000000004002

CREATE TABLE

0x0000000000004004

ALTER TABLE

0x0000000000004008

DROP TABLE

0x0000000000004010

CREATE PROCEDURE

0x0000000000004020

ALTER PROCEDURE

0x0000000000004040

DROP PROCEDURE

0x0000000000004080

CREATE FUNCTION

0x0000000000004100

ALTER FUNCTION

0x0000000000004200

DROP FUNCTION

0x0000000000004400

CREATE TRIGGER

0x0000000000004800

ALTER TRIGGER

0x0000000000005000

DROP TRIGGER

0x0000000000014000

CREATE EXCEPTION

0x0000000000024000

ALTER EXCEPTION

0x0000000000044000

DROP EXCEPTION

0x0000000000084000

CREATE VIEW

0x0000000000104000

ALTER VIEW

0x0000000000204000

DROP VIEW

0x0000000000404000

CREATE DOMAIN

0x0000000000804000

ALTER DOMAIN

0x0000000001004000

DROP DOMAIN

0x0000000002004000

CREATE ROLE

0x0000000004004000

ALTER ROLE

0x0000000008004000

DROP ROLE

0x0000000010004000

CREATE INDEX

0x0000000020004000

ALTER INDEX

0x0000000040004000

DROP INDEX

0x0000000080004000

CREATE SEQUENCE

0x0000000100004000

ALTER SEQUENCE

0x0000000200004000

DROP SEQUENCE

0x0000000400004000

CREATE USER

0x0000000800004000

ALTER USER

0x0000001000004000

DROP USER

0x0000002000004000

CREATE COLLATION

0x0000004000004000

DROP COLLATION

0x0000008000004000

ALTER CHARACTER SET

0x0000010000004000

CREATE PACKAGE

0x0000020000004000

ALTER PACKAGE

0x0000040000004000

DROP PACKAGE

0x0000080000004000

CREATE PACKAGE BODY

0x0000100000004000

DROP PACKAGE BODY

0x0000200000004000

CREATE MAPPING

0x0000400000004000

ALTER MAPPING

0x0000800000004000

DROP MAPPING

0x7FFFFFFFFFFFDFFE

ANY DDL STATEMENT

For example a trigger with
BEFORE CREATE PROCEDURE OR CREATE FUNCTION will be of type 0x0000000000004090,
AFTER CREATE PROCEDURE OR CREATE FUNCTION — 0x0000000000004091,
BEFORE DROP FUNCTION OR DROP EXCEPTION — 0x00000000000044200,
AFTER DROP FUNCTION OR DROP EXCEPTION — 0x00000000000044201,
BEFORE DROP TRIGGER OR DROP DOMAIN — 0x00000000001005000,
AFTER DROP TRIGGER OR DROP DOMAIN — 0x00000000001005001.

RDB$TRIGGER_MESSAGES

RDB$TRIGGER_MESSAGES stores the trigger messages.

Column Name Data Type Description

RDB$TRIGGER_NAME

CHAR(63)

The name of the trigger the message is associated with

RDB$MESSAGE_NUMBER

SMALLINT

The number of the message within this trigger (from 1 to 32,767)

RDB$MESSAGE

VARCHAR(1023)

Text of the trigger message

RDB$TYPES

RDB$TYPES stores the defining sets of enumerated types used throughout the system.

Column Name Data Type Description

RDB$FIELD_NAME

CHAR(63)

Enumerated type name.Each type name masters its own set of types, e.g., object types, data types, character sets, trigger types, blob subtypes, etc.

RDB$TYPE

SMALLINT

The object type identifier.A unique series of numbers is used within each separate enumerated type.For example, for the RDB$OBJECT_TYPE enumerated type, examples of object types are:

0 - TABLE
1 - VIEW
2 - TRIGGER
 …​

RDB$TYPE_NAME

CHAR(63)

The name of a member of an enumerated type, e.g., TABLE, VIEW, TRIGGER, etc. in the example above.In the RDB$CHARACTER_SET enumerated type, RDB$TYPE_NAME stores the names of the character sets.

RDB$DESCRIPTION

BLOB TEXT

Any text comments related to the enumerated type

RDB$SYSTEM_FLAG

SMALLINT

Flag: indicates whether the type-member is user-defined (value 0) or system-defined (value 1 or greater)

RDB$CHECK_CONSTRAINTS

RDB$CHECK_CONSTRAINTS provides the cross references between the names of system-generated triggers for constraints and the names of the associated constraints (NOT NULL constraints, CHECK constraints and the ON UPDATE and ON DELETE clauses in foreign key constraints).

Column Name Data Type Description

RDB$CONSTRAINT_NAME

CHAR(63)

Constraint name, defined by the user or automatically generated by the system

RDB$TRIGGER_NAME

CHAR(63)

For a CHECK constraint, it is the name of the trigger that enforces this constraint.For a NOT NULL constraint, it is the name of the table the constraint is applied to.For a foreign key constraint, it is the name of the trigger that enforces the ON UPDATE, ON DELETE clauses.

RDB$USER_PRIVILEGES

RDB$USER_PRIVILEGES stores the SQL access privileges for Firebird users and privileged objects.

Column Name Data Type Description

RDB$USER

CHAR(63)

The user or object that is granted this privilege

RDB$GRANTOR

CHAR(63)

The user who grants the privilege

RDB$PRIVILEGE

CHAR(6)

The privilege granted hereby:

A - all (all privileges)
S - select (selecting data)
I - insert (inserting rows)
D - delete (deleting rows)
R - references (foreign key)
U - update (updating data)
X - executing (procedure)
G - usage (of other object types)
M - role membership
C - DDL privilege create
L - DDL privilege alter
O - DDL privilege drop

RDB$GRANT_OPTION

SMALLINT

Whether the WITH GRANT OPTION authority is included with the privilege:

0 - not included
1 - included

RDB$RELATION_NAME

CHAR(63)

The name of the object (table, view, procedure or role) the privilege is granted ON

RDB$FIELD_NAME

CHAR(63)

The name of the column the privilege is applicable to, for a column-level privilege (an UPDATE or REFERENCES privilege)

RDB$USER_TYPE

SMALLINT

Identifies the type of user the privilege is granted TO (a user, a procedure, a view, etc.)

RDB$OBJECT_TYPE

SMALLINT

Identifies the type of the object the privilege is granted ON

0 - table
1 - view
2 - trigger
5 - procedure
7 - exception
8 - user
9 - domain
11 - character set
13 - role
14 - generator (sequence)
15 - function
16 - BLOB filter
17 - collation
18 - package

RDB$VIEW_RELATIONS

RDB$VIEW_RELATIONS stores the tables that are referred to in view definitions.There is one record for each table in a view.

Column Name Data Type Description

RDB$VIEW_NAME

CHAR(63)

View name

RDB$RELATION_NAME

CHAR(63)

The name of the table, view or stored procedure the view references

RDB$VIEW_CONTEXT

SMALLINT

The alias used to reference the view column in the BLR code of the query definition

RDB$CONTEXT_NAME

CHAR(255)

The text associated with the alias reported in the RDB$VIEW_CONTEXT column

RDB$CONTEXT_TYPE

SMALLINT

Context type:

0 - table
1 - view
2 - stored procedure

RDB$PACKAGE_NAME

CHAR(63)

Package name for a stored procedure in a package

RDB$COLLATIONS

RDB$COLLATIONS stores collations for all character sets.

Column Name Data Type Description

RDB$COLLATION_NAME

CHAR(63)

Collation name

RDB$COLLATION_ID

SMALLINT

Collation identifier.Together with the character set identifier, it is a unique collation identifier

RDB$CHARACTER_SET_ID

SMALLINT

Character set identifier.Together with the collection sequence identifier, it is a unique identifier

RDB$COLLATION_ATTRIBUTES

SMALLINT

Collation attributes.It is a bit mask where the first bit shows whether trailing spaces should be taken into account in collations (0 - NO PAD; 1 - PAD SPACE);the second bit shows whether the collation is case-sensitive (0 - CASE SENSITIVE, 1 - CASE INSENSITIVE);the third bit shows whether the collation is accent-sensitive (0 - ACCENT SENSITIVE, 1 - ACCENT SENSITIVE).Thus, the value of 5 means that the collation does not take into account trailing spaces and is accent-insensitive

RDB$SYSTEM_FLAG

SMALLINT

Flag: the value of 0 means it is user-defined;the value of 1 means it is system-defined

RDB$DESCRIPTION

BLOB TEXT

Could store text description of the collation

RDB$FUNCTION_NAME

CHAR(63)

Not currently used

RDB$BASE_COLLATION_NAME

CHAR(63)

The name of the base collation for this collation

RDB$SPECIFIC_ATTRIBUTES

BLOB TEXT

Describes specific attributes

RDB$SECURITY_CLASS

CHAR(63)

May reference a security class defined in the table RDB$SECURITY_CLASSES, to apply access control limits to all users of this collation

RDB$OWNER_NAME

CHAR(63)

The username of the user who created the collation originally

RDB$CONFIG

RDB$CONFIG is a virtual table showing the configuration settings of the current database for the current connection.

Table RDB$CONFIG is populated from in-memory structures upon request and its instance is preserved for the SQL query lifetime.For security reasons, access to this table is allowed for administrators only.Non-privileged users see no rows in this table (and no error is raised).

Column Name Data Type Description

RDB$CONFIG_ID

INTEGER

Unique row identifier, no special meaning

RDB$CONFIG_NAME

VARCHAR(63)

Setting name (e.g. TempCacheLimit)

RDB$CONFIG_VALUE

VARCHAR(255)

Actual value of setting

RDB$CONFIG_DEFAULT

VARCHAR(255)

Default value of setting (defined in the Firebird code)

RDB$CONFIG_IS_SET

BOOLEAN

TRUE if value is explicitly configured, FALSE when default

RDB$CONFIG_SOURCE

VARCHAR(255)

Name of the configuration file (relative to the Firebird root directory) where this setting was taken from, or special value DPB if the setting was specified by the client application via API.

RDB$DATABASE

RDB$DATABASE stores basic information about the database.It contains only one record.

Column Name Data Type Description

RDB$DESCRIPTION

BLOB TEXT

Database comment text

RDB$RELATION_ID

SMALLINT

A number that steps up by one each time a table or view is added to the database

RDB$SECURITY_CLASS

CHAR(63)

The security class defined in RDB$SECURITY_CLASSES to apply access control limits common to the entire database

RDB$CHARACTER_SET_NAME

CHAR(63)

The name of the default character set for the database set in the DEFAULT CHARACTER SET clause when the database is created.NULL for character set NONE.

RDB$LINGER

INTEGER

Number of seconds "delay" (established with the ALTER DATABASE SET LINGER statement) until the database file is closed after the last connection to this database is closed (in SuperServer).NULL if no delay is set.

RDB$SQL_SECURITY

BOOLEAN

The default SQL SECURITY mode (DEFINER or INVOKER) applied to newly created objects:

NULL - initial default (INVOKER)
FALSE - INVOKER
TRUE - DEFINER

RDB$DB_CREATORS

RDB$DB_CREATORS contains a list of users granted the CREATE DATABASE privilege when using the specified database as a security database.

Column Name Data Type Description

RDB$USER

CHAR(63)

User or role name

RDB$USER_TYPE

SMALLINT

Type of user

8 - user
13 - role

RDB$DEPENDENCIES

RDB$DEPENDENCIES stores the dependencies between database objects.

Column Name Data Type Description

RDB$DEPENDENT_NAME

CHAR(63)

The name of the view, procedure, trigger, CHECK constraint or computed column the dependency is defined for, i.e., the dependent object

RDB$DEPENDED_ON_NAME

CHAR(63)

The name of the object that the defined object — the table, view, procedure, trigger, CHECK constraint or computed column — depends on

RDB$FIELD_NAME

CHAR(63)

The column name in the depended-on object that is referred to by the dependent view, procedure, trigger, CHECK constraint or computed column

RDB$DEPENDENT_TYPE

SMALLINT

Identifies the type of the dependent object:

0 - table
1 - view
2 - trigger
3 - computed column
4 - CHECK constraint
5 - procedure
6 - index expression
7 - exception
8 - user
9 - column
10 - index
15 - stored function
18 - package header
19 - package body

RDB$DEPENDED_ON_TYPE

SMALLINT

Identifies the type of the object depended on:

0 - table (or a column in it)
1 - view
2 - trigger
3 - computed column
4 - CHECK constraint
5 - procedure (or its parameter(s))
6 - index expression
7 - exception
8 - user
9 - column
10 - index
14 - generator (sequence)
15 - UDF or stored function
17 - collation18 - package header
19 - package body

RDB$PACKAGE_NAME

CHAR(63)

The package of a procedure or function for which this describes the dependency.