25.09.2018 20:39, Vlad Khorsun wrote:
25.09.2018 19:02, Karol Bieniaszewski wrote:
...
b) run query which returns resultset AND currently used CN as one of the
resultset
column and put it into lastCN variable above:
SELECT NAMES.*, RDB$GET_CONTEXT('SYSTEM', 'SNAPSHOT_CN') as Current_CN
FROM NAMES
WHERE RDB$GET_TRANSACTION_CN(RDB$RECORD_VERSION) > :lastCN;
...
But this is for optimization only. We can add index there.
Expression index, correct ?
Ooops, index computed as RDB$GET_TRANSACTION_CN(RDB$RECORD_VERSION) just
can't work as function RDB$GET_TRANSACTION_CN is non-deterministic and will
change its value when transaction commits and\or after database restart.
Regards,
Vlad
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel