Subject | Re: [IBO] RDB$DB_KEY |
---|---|
Author | Helen Borrie |
Post date | 2007-01-24T21:59:50Z |
At 03:39 AM 25/01/2007, you wrote:
The RDB$DB_KEY is referenced by IBO in DML operations
(Insert/Delete/Update) when you have not provided KeyLinks and/or the
table has no primary key. It is used internally for some operations
on views, which have no primary key. Under the default connection
conditions, this key is not reliable across transaction boundaries.
Always define a primary key for a table. On simple queries, setting
KeyLinksAutoDefine will set the KeyLinks automatically using the
table's metadata if possible, as long as the primary key is defined
and is present in the fields specification. For all other queries
and for unkeyed tables you need to define the KeyLinks manually by
listing the field names of a unique combination in the KeyLinks
property of the dataset.
A record that has just been inserted, but is not committed, has no
RDB$DBKEY, so inserting and then later updating or deleting a keyless
record in the same transaction could raise this or other errors. So
could deleting a keyless record, committing it and then trying to
refer to the record without refreshing or invalidating the query.
If this isn't enough to get you to a solution, then provide more
information - version of IBO, metadata for the table, SQL string used
for the query, and so on.
Helen
>Hello,Well, you are not providing much information here.
>I have given my App including Database to a customer.
>After trying this and that and correcting bugs he gets an Error like
>"Error in DML something Invalid RDB$DB_Key".
>
>
>What did I do wrong, what do I Have to do better and how can I get rid
>of this error?
The RDB$DB_KEY is referenced by IBO in DML operations
(Insert/Delete/Update) when you have not provided KeyLinks and/or the
table has no primary key. It is used internally for some operations
on views, which have no primary key. Under the default connection
conditions, this key is not reliable across transaction boundaries.
Always define a primary key for a table. On simple queries, setting
KeyLinksAutoDefine will set the KeyLinks automatically using the
table's metadata if possible, as long as the primary key is defined
and is present in the fields specification. For all other queries
and for unkeyed tables you need to define the KeyLinks manually by
listing the field names of a unique combination in the KeyLinks
property of the dataset.
A record that has just been inserted, but is not committed, has no
RDB$DBKEY, so inserting and then later updating or deleting a keyless
record in the same transaction could raise this or other errors. So
could deleting a keyless record, committing it and then trying to
refer to the record without refreshing or invalidating the query.
If this isn't enough to get you to a solution, then provide more
information - version of IBO, metadata for the table, SQL string used
for the query, and so on.
Helen