Subject Re: [IBO] rdb$db_key in a select
Author lester@lsces.co.uk
> Not all tables have a primary key. I want to have a standard way of
> referencing a lot of different tables to calculate checksums for
> records. Instead of adding an autoincremet to each field, it would
> be very helpful if I could access the RDB$DB_KEY for this.
>
> My question is realyl that if the facility is present, and I can see
> from other messages that one would appear to be able to use it, how
> do I get access to the RDB$DB_KAY in my code. I understand your
> comments about the use of primary keys, but, for various reasons, I
> need access to the RBD$DB_KAY.

I think you need to do smoe serious reading on Firebird and
SQL in general. DB_KEY is probably of little use if you need
a reliable order of records in order to produce a checksum.
The DB_KEY will change when a record is updated and
committed. If you need a reproducable order for a scanning a
table, then it needs to be added. If you don't need the
order, then just scan the raw table.

I repeat the question. Why do you think you need to use
DB_KEY?

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services