Unless explicitly mentioned otherwise in an “Available in” section, context variables are available in at least DSQL and PSQL.Availability in ESQL is — bar some exceptions — not tracked by this Language Reference.
Unless explicitly mentioned otherwise in an “Available in” section, context variables are available in at least DSQL and PSQL.Availability in ESQL is — bar some exceptions — not tracked by this Language Reference.
CURRENT_CONNECTION
Unique identifier of the current connection.
BIGINT
CURRENT_CONNECTION
Its value is derived from a counter on the database header page, which is incremented for each new connection.When a database is restored, this counter is reset to zero.
select current_connection from rdb$database
execute procedure P_Login(current_connection)
INSERTING
Indicates if the trigger fired for an INSERT
operation
PSQL — triggers only
BOOLEAN
INSERTING
Intended for use in multi-action triggers.
if (inserting or updating) then
begin
if (new.serial_num is null) then
new.serial_num = gen_id(gen_serials, 1);
end
LOCALTIME
Current server time in the session time zone, without time zone information
TIME WITHOUT TIME ZONE
LOCALTIME [ (<precision>) ] <precision> ::= 0 | 1 | 2 | 3
The optional precision argument is not supported in ESQL.
Parameter | Description |
---|---|
precision |
Precision.The default value is 0.Not supported in ESQL |
LOCALTIME
returns the current server time in the session time zone.The default is 0 decimals, i.e. seconds precision.
Note
|
|
select localtime from rdb$database
-- returns e.g. 14:20:19.0000
select localtime(2) from rdb$database
-- returns e.g. 14:20:23.1200