FirebirdSQL logo

RDB$FUNCTIONS

RDB$FUNCTIONS stores the information needed by the engine about stored functions and external functions (user-defined functions, UDFs).

Column Name Data Type Description

RDB$FUNCTION_NAME

CHAR(63)

The unique (declared) name of the external function

RDB$FUNCTION_TYPE

SMALLINT

Not currently used

RDB$QUERY_NAME

CHAR(63)

Not currently used

RDB$DESCRIPTION

BLOB TEXT

Any text with comments related to the external function

RDB$MODULE_NAME

VARCHAR(255)

The name of the dynamic library or shared object where the code of the external function is located

RDB$ENTRYPOINT

CHAR(255)

The exported name of the external function in the function library.Note, this is often not the same as RDB$FUNCTION_NAME, which is the identifier with which the external function is declared to the database

RDB$RETURN_ARGUMENT

SMALLINT

The position number of the returned argument in the list of parameters corresponding to input arguments

RDB$SYSTEM_FLAG

SMALLINT

Flag indicating whether the filter is user-defined or internally defined:

0 - user-defined
1 - internally defined

RDB$ENGINE_NAME

CHAR(63)

Engine for external functions.'UDR' for UDR functions.NULL for legacy UDF or PSQL functions

RDB$PACKAGE_NAME

CHAR(63)

Package that contains this function (or NULL)

RDB$PRIVATE_FLAG

SMALLINT

NULL for normal (top-level) functions, 0 for package function defined in the header, 1 for package function only defined in the package body.

RDB$FUNCTION_SOURCE

BLOB TEXT

The PSQL sourcecode of the function

RDB$FUNCTION_ID

SMALLINT

Unique identifier of the function

RDB$FUNCTION_BLR

BLOB BLR

The binary language representation (BLR) of the function code (PSQL function only)

RDB$VALID_BLR

SMALLINT

Indicates whether the source PSQL of the stored procedure remains valid after the latest ALTER FUNCTION modification

RDB$DEBUG_INFO

BLOB DEBUG_INFORMATION

Contains debugging information about variables used in the function (PSQL function only)

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 function

RDB$OWNER_NAME

CHAR(63)

The username of the user who created the function originally

RDB$LEGACY_FLAG

SMALLINT

The legacy style attribute of the function.1 - if the function is described in legacy style (DECLARE EXTERNAL FUNCTION),otherwise CREATE FUNCTION.

RDB$DETERMINISTIC_FLAG

SMALLINT

Deterministic flag.1 - if function is deterministic

RDB$SQL_SECURITY

BOOLEAN

The SQL SECURITY mode (DEFINER or INVOKER):

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

RDB$FUNCTION_ARGUMENTS

RDB$FUNCTION_ARGUMENTS stores the parameters of functions and their attributes.

Column Name Data Type Description

RDB$FUNCTION_NAME

CHAR(63)

The unique name (declared identifier) of the function

RDB$ARGUMENT_POSITION

SMALLINT

The position of the argument in the list of arguments

RDB$MECHANISM

SMALLINT

Flag: how this argument is passed:

0 - by value
1 - by reference
2 - by descriptor
3 - by BLOB descriptor
4 - by scalar array
5 - by reference with null

Only for legacy external functions.

RDB$FIELD_TYPE

SMALLINT

Data type code defined for the column:

7 - SMALLINT
8 - INTEGER
10 - FLOAT
12 - DATE
13 - TIME
14 - CHAR
16 - BIGINT
23 - BOOLEAN
24 - DECFLOAT(16)
25 - DECFLOAT(34)
26 - INT128
27 - DOUBLE PRECISION
28 - TIME WITH TIME ZONE
29 - TIMESTAMP WITH TIME ZONE
35 - TIMESTAMP
37 - VARCHAR
40 - CSTRING (null-terminated text)
45 - BLOB_ID
261 - BLOB

Only for legacy external functions.

RDB$FIELD_SCALE

SMALLINT

The scale of an integer or a fixed-point argument.It is an exponent of 10.

Only for legacy external functions.

RDB$FIELD_LENGTH

SMALLINT

Argument length in bytes:

BOOLEAN = 1
SMALLINT = 2
INTEGER = 4
DATE = 4
TIME = 4
BIGINT = 8
DECFLOAT(16) = 8
DOUBLE PRECISION = 8
TIMESTAMP = 8
TIME WITH TIME ZONE = 8
BLOB_ID = 8
TIMESTAMP WITH TIME ZONE = 12
INT128 = 16
DECFLOAT(34) = 16

Only for legacy external functions.

RDB$FIELD_SUB_TYPE

SMALLINT

Stores the BLOB subtype for an argument of a BLOB data type.

Only for legacy external functions.

RDB$CHARACTER_SET_ID

SMALLINT

The identifier of the character set for a character argument.

Only for legacy external functions.

RDB$FIELD_PRECISION

SMALLINT

The number of digits of precision available for the data type of the argument.

Only for legacy external functions.

RDB$CHARACTER_LENGTH

SMALLINT

The length of a CHAR or VARCHAR argument in characters (not in bytes).

Only for legacy external functions.

RDB$PACKAGE_NAME

CHAR(63)

Package name of the function (or NULL for a top-level function)

RDB$ARGUMENT_NAME

CHAR(63)

Parameter name

RDB$FIELD_SOURCE

CHAR(63)

The name of the user-created domain, when a domain is referenced instead of a data type.If the name starts with the prefix “RDB$”, it is the name of the domain automatically generated by the system for the parameter.

RDB$DEFAULT_VALUE

BLOB BLR

The binary language representation (BLR) of the default value of the parameter

RDB$DEFAULT_SOURCE

BLOB TEXT

The default value for the parameter, in PSQL code

RDB$COLLATION_ID

SMALLINT

The identifier of the collation used for a character parameter

RDB$NULL_FLAG

SMALLINT

The flag indicating whether NULL is allowable

RDB$ARGUMENT_MECHANISM

SMALLINT

Parameter passing mechanism for non-legacy functions:

0 - by value
1 - by reference
2 - through a descriptor
3 - via the BLOB descriptor

RDB$FIELD_NAME

CHAR(63)

The name of the column the parameter references, if it was declared using TYPE OF COLUMN instead of a regular data type.Used in conjunction with RDB$RELATION_NAME (see next).

RDB$RELATION_NAME

CHAR(63)

The name of the table the parameter references, if it was declared using TYPE OF COLUMN instead of a regular data type

RDB$SYSTEM_FLAG

SMALLINT

Flag:

0 - user-defined
1 or higher - system-defined

RDB$DESCRIPTION

BLOB TEXT

Optional description of the function argument (comment)