I need to convert SQL statements RDB$GET_CONTEXT
and RDB$SET_CONTEXT
from Firebird to Interbase so what I should use ?
Here is the complete Firebird SQL:
if (rdb$get_context('USER_TRANSACTION', 'Lock_Trigger') = '1') then exit;
I need to convert SQL statements RDB$GET_CONTEXT
and RDB$SET_CONTEXT
from Firebird to Interbase so what I should use ?
Here is the complete Firebird SQL:
if (rdb$get_context('USER_TRANSACTION', 'Lock_Trigger') = '1') then exit;
These functions are more or less* shortcuts for accessing Firebird's key-value system table. You can imitate it with Global Temporary Tables
ON COMMIT DELETE
GTT imitates*context('USER_TRANSACTION'...)
whileON COMMIT PRESERVE
imitates*context('USER_SESSION'...)
. Refer to Interbase DataDef manual for details.So you can create GTT with fields (KEY, VALUE) and simply insert/update/select the values you need:
Note that collisions are possible with
COMMIT PRESERVE ROWS
GTT's when reading/writing the same value from multiple transactions of the same attachment.*I believe these functions also provide atomic type of operations to avoid read-write collisions.