My Oracle Support Banner

ERROR DURING EXECUTION OF OWM TRIGGER DUE TO INTEGRITY CONSTRAINT VIOLATION (Doc ID 964843.1)

Last updated on MARCH 28, 2019

Applies to:

Workspace Manager - Version 10.2.0.4.4 and later
Information in this document applies to any platform.

Symptoms

We have a parent-child relationship (Foreign Key)
Both tables are version enabled.

Inserting a record into the PARENT table generates error:

ERROR at line 1:
ORA-20006: integrity constraint (SCOTT.CHILD_FK) violated - parent key not
found
ORA-06512: at "SCOTT.OVM_INSERT_9", line 4
ORA-04088: error during execution of trigger 'SCOTT.OVM_INSERT_9'
ORA-06512: at "SCOTT.OVM_INSERT_10", line 3
ORA-04088: error during execution of trigger 'SCOTT.OVM_INSERT_10'



This should not be the case because we are inserting into the PARENT table
not the CHILD table.

There is an AFTER INSERT PER ROW trigger created on the PARENT table:

CREATE OR REPLACE TRIGGER I_CREATE_CHILD
AFTER INSERT ON PARENT
FOR EACH ROW
BEGIN
INSERT INTO child (child_id, parent_id) VALUES (:new.parent_id,
:new.Parent_id);
END;
/

According to the documentation this trigger seems to be allowed.
As it is an after insert, the row in the PARENT table should be there to
validate the insert that is going into the CHILD table.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.