Subject Re: [firebird-support] Walk me thru setting up Ref. Integrity
Author Don Gollahon
"Helen Borrie" <helebor@...> wrote in message
news:<5.2.0.9.2.20040718103811.0787b008@...>...
>
> No, just complete any transaction that is looking at the tables, i.e.
> close
> any table viewer or query window that has one or both tables occupied and
> complete the existing transaction. You will get an Object In Use
exception
> if you don't.
>
> Once the tables are clear of all outstanding transactions, you will be
> able
> to create the foreign key relationship.
>
> However, you also reported this error:
>
> This operation is not defined for system tables.
> unsuccessful metadata update.
> STORE RDB$INDICES failed.
> attempt to store duplicate value (visible to active transactions) in
> unique index "RDB$INDEX_5".
>
> This indicates that the key has already been created, but has been
> deferred
> because one or both tables were in use. So you could try just closing
> IBExpert, shutting down the server and restarting it, and going back into
> IBExpert to see whether you now have that constraint in place.
>
> Remember, these admin tools do their stuff by running queries inside
> transactions, just like any client application. You need to be aware of
> what's already going on in the database before attempting to change
metadata...
>
> /heLen
>
>

I discovered the problem. I had a few records with bad data in the personid
field (thus one of my reasons for adding RI).

Thanks for the help everyone.

BTW, Helen, the price of your book is listed in lbs. Approximately what is
it in $?

Thanks.

_________________________________________
Don Gollahon
dlgllhn@...
ICQ#: 115831669
"What in Eternity does it matter?"
_________________________________________