Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: error 02291 "parent key not found" (help for newbie)
<pscola_at_tiscalinet.it> wrote in message
news:3a0da416.3614193_at_news.tiscalinet.it...
> Hi everybody,
>
> I would ask you why I got the following error message
> after I tried to insert a row in table on my DB.
>
> 02291, 00000,"integrity constraint (%s.%s) violated - parent key not
found"
> // *Cause: attempted to insert or update values that do not have
corresponding
> // Parent key values.
> // *Action: obvious.
>
> And mainly, how may I avoid in the future ?
>
>
>
> Thank you in advance for your help.
>
> Kind regards,
> Paolo
Paolo,
The table you are inserting into has a foreign key, and the row you are inserting has a value in that foreign key field that has no corresponding value as a primary key in the referenced table. There are two ways to avoid this in the future... the simplest is to remove the foreign key, but this may violate policy so you probably want to keep the foreign key there. The other way is to make sure that the primary key value in the referenced table exists, so add it if it is missing.
Noel
URL: http://www.mindspring.com/~noelmckinney/
Received on Sat Nov 11 2000 - 16:10:57 CST