Re: Problems when adding foreign keys
Posted in 2011
Hello. You might also check if yours AUTO_REPREPARE onconfig var is turned on, since it reduces lots of 710 errors that previously versions generated. Regards. Em 02/08/2011 03:39, Keith Simmons escreveu: > Ulf > > Any change of the table structure requires an exclusive lock and > adding a constraint (such as a foreign key) is such a change. > -710 simply indicates the structrue of the table has changed. > by adding a foreign key !!, since the last time that process > accessed the table. If you had restarted the process, so that > it connected to the new 'version' of the table , you would not > have seen the error. Also it should not appear on any new > connections. > > Keith > > On 2 August 2011 07:56, Ulf<ulf.akerberg@gmail.com> wrote: >> Hi ! >> >> We are using version 11.50.FC6W2 on HP-UX 11.31 >> >> I have on several occasions run into a problem when adding foreign >> keys, the problem is the following. >> >> I have a table A with a primary key. I now add a table B that has a >> foreign key constraint to the primary key on table A. >> >> Problem 1. If it is not possible to lock table A in exclusive mode I >> can't add the foreign key. Why is there a need for an exclusive lock >> on table A in this situation ? >> >> Problem 2. If I succed to add the foreign key I get -710 errors when >> trying to update table A.Why the -710 error on table A ? >> The solution I have found is to do an update statistics on table A. Is >> there other ways around the problem ? >> >> >> The behavior might have changed in later versions. >> >> TIA >> >> Ulf >> >> _______________________________________________ >> Informix-list mailing list >> Informix-list@iiug.org >> http://www.iiug.org/mailman/listinfo/informix-list >> > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > -- Alexandre Marini Tecnologia da Informação - DBA msn: alexandre_marini@hotmail.com SEFAZ-MS / SGI-UGSR / Sistemas IBM-Informix <Cert-Info-Mgmt_color.jpg> IBM Certified System Administrator - Informix Dynamic Server V10 / V11 / V11.70 IBM Information Management Informix Technical Professional v3