Subject Re: Deleting a duplicate row from a corrupt database
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, Ales Smodis <aless@z...> wrote:
> Alexander V.Nevsky wrote:
> I've used the RDB$DB_KEY a few times in the past and somehow didn't
> think of it to help me solve this problem. :) Basically you'd have to
> declare a variable of type char(8), then add RDB$DB_KEY to the list of
> fields to be returned by select and then use it in the delete
statement.
> Something like this:

[skipped]

in fact cursor usage and rdb$db_key usage are the same, cursor saves
one short step - positioning of delete, because cursor uses rdb$db_key
implicitly and insures that it is already positioned. I tried to say -
nothing prevent us from usage of rdb$db_key not only in PSQL but on
client side too, but I have no expereince with this.

> On the other hand, is there a web page explaining cursors in more
> detail? This is the first time I've seen them used in a stored
procedure
> and since the original PDF manuals for Interbase 6 don't mention
them at
> all in the sections explaining stored procedure and trigger language,
> and are otherwise just more-or-less cryptically noted in the Language
> Reference, I'd like to learn more about them from other sources, if
> possible.

The best I know are several articles by Claudio placed on his
excellent site www.cvalde.net . Type "rdb$db_key" in search edit there
and enjoy ;)

Best regards,
Alexander