Skip to main content

Functions, arguments, types

The functions and procedures are collected in the tables below. It provides an roadmap to check availability of operations supported.

sys.functions
name type references description
"id" INTEGER   The internal identifier for the function.
"name" VARCHAR   The SQL name.
"func" VARCHAR   MAL function identifier or SQL function definition.
"mod" VARCHAR   MAL function module identifier.
"language" INTEGER   The languagecode in which the function is defined: 0=internal C/mal, 1=external C, 2=SQL.
"type" INTEGER   Type of function: 1=scalar function, 2= procedure, 3=aggregate function, 4=filter function,
5=function returning a table result.
"side_effect" BOOLEAN   It does (not) lead to updates.
"varres" BOOLEAN   Does the function have varres?
"vararg" BOOLEAN   Can the function be called with  a variable number of arguments?
"schema_id" INTEGER sys.schemas.id The schema identifier.
sys.systemfunctions
name type references description
"function_id" INTEGER sys.functions.id

The internal identifier of a system function.
Note: this is not a system controlled foreign key reference, and is not automatically
removed when the referred function is dropped from sys.functions.

sys.args
name type references description
"id" INTEGER   The internal identifier for function argument.
"func_id" INTEGER sys.functions.id The corresponding function.
"name" VARCHAR   The SQL name.
"type" VARCHAR   The SQL type name.
"type_digits" INTEGER   The number of digits for number types.
"type_scale" INTEGER   The precision after decimal point.
"inout" TINYINT   Whether the argument is usable for input (=0) or output or both (=1).
"number" INTEGER   The function argument position ranging from 1 to n. Number 0 represents the return arg type.
sys.types
name type references description
"id" INTEGER   The internal identifier for the data type.
"systemname" VARCHAR   MAL data type name.
"sqlname" VARCHAR   SQL data type name.
"digits" INTEGER   The number of digits (in the specified radix) for numerical, floating point,
time, timestamp and interval types.
"scale" INTEGER   Type of scale. 0=not applicable, 1=decimal, 2=exponential (floating point).
"radix" INTEGER   Radix for the number of digits value: 2 (= binary) or 10 (= decimal).
"eclass" INTEGER   The internal storage class equivalence identifier.
"schema_id" INTEGER sys.schemas.id
when != 0
The corresponding schema when it is user defined type.
When schema_id is 0 then it represents a built-in core data type.