Print Thread
ORA-02291 integrity constraint violated - parent key not found
#7856 10/10/05 09:24 AM
Joined: Sep 2003
Posts: 22
W
Member
OP Offline
Member
W
Joined: Sep 2003
Posts: 22
Hello,

I use the components of Doa Versions 4.0.3. I have three tables in a master-detail relationship. The first table tab1 is master of table tab2. tab2 is additional master of tab3. After I insert in all three table a record like this

tab1.insert;
tab2.insert;
tab3.insert;

and I just try to post the changes on tab1 like this

if tab1.State in [dsInsert, dsEdit] then tab1.post;

then I`ll get the ORA-02291 error, cause doa try to post first the changes of tab3. What is the reason? I`ll set the property CommitOnPost to false. Could anyone give me a solution? Thanks in advance.

Re: ORA-02291 integrity constraint violated - parent key not found
#7857 10/10/05 09:41 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
I can't imagine why this would happen. Do you have any event handlers on the tab1 dataset that could cause this?


Marco Kalter
Allround Automations
Re: ORA-02291 integrity constraint violated - parent key not found
#7858 10/11/05 09:50 AM
Joined: Sep 2003
Posts: 22
W
Member
OP Offline
Member
W
Joined: Sep 2003
Posts: 22
I only declared AfterInsert-events for all three tables to set default values of not null columns.

Re: ORA-02291 integrity constraint violated - parent key not found
#7859 10/11/05 09:45 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
What happens if you remove these events?


Marco Kalter
Allround Automations
Re: ORA-02291 integrity constraint violated - parent key not found
#7860 10/12/05 09:33 AM
Joined: Sep 2003
Posts: 22
W
Member
OP Offline
Member
W
Joined: Sep 2003
Posts: 22
The same.

Re: ORA-02291 integrity constraint violated - parent key not found
#7861 10/12/05 09:22 PM
Joined: Oct 2005
Posts: 2
G
Member
Offline
Member
G
Joined: Oct 2005
Posts: 2
The CommitOnPost property should not be a factor. Committing allows your updates to be visible to others in the database. All your issue at this point remain local to your session.

What Primary Keys are propogating from Master to Detail to join the tables together? Are they values from sequences?

Re: ORA-02291 integrity constraint violated - parent key not found
#7862 10/13/05 09:11 AM
Joined: Sep 2003
Posts: 22
W
Member
OP Offline
Member
W
Joined: Sep 2003
Posts: 22
The first and second table have respectively two PKs - one of them with a sequence. The third table has two PKs without a sequence.

Re: ORA-02291 integrity constraint violated - parent key not found
#7863 11/14/05 03:21 PM
Joined: Sep 2003
Posts: 22
W
Member
OP Offline
Member
W
Joined: Sep 2003
Posts: 22
Isn`t anybody out there? My problem still exists but I don`t get any response since one month.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.053s Queries: 13 (0.006s) Memory: 2.5234 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-09 16:57:18 UTC
Valid HTML 5 and Valid CSS