I have several tables in my data base however 3 are important. One of them is Employee(Employee_ID, Name, Last_Name and other irrelevant columns), Dentist(Employee_ID, Qualifications) and Assistant(Employee_ID, Qualifications).
I'm making an application in Oracle Application Express and upon attempting to update a row in the Employee table I get a ORA-20505: Error in DML: p_rowid=96, p_alt_rowid=Employee_ID, p_rowid2=, p_alt_rowid2=. ORA-02292: integrity constraint (DB.Dentist_CON) violated - child record found
Now, to begin with I had the same problems with deleting rows but I solved that by adding an on cascade delete to my foreign keys.
I have foreign key constraints both in my Dentist and Assistant tables in the Employee_ID columns and these are referencing Employee_ID in the Employee table.
When I'm updating anything within my form in Application Express, I haven't allowed the users to do anything to the primary key (Employee_ID) from my Employee table. So any changes that might happen are to columns irrelevant to the primary key. For instance, if I change the Name column of a particular row I can't update because I get the above-mentioned error.
I don't understand why this is happening.
If I could have any insight into why this is happening or help of any form I'd greatly appreciate it.
Thanks in advance.
How do I ask a question on the forums?
02292, 00000,"integrity constraint (%s.%s) violated - child record found" // *Cause: attempted to delete a parent key value that had a foreign // key dependency. // *Action: delete dependencies first then parent or disable constraint.
982909 wrote:the code below shows above is NOT true
But it's not true. If I'm trying to change Name from Employee and update that row in Employee WITHOUT changing the value of Employee_ID how can I possibly change the child row? This is what's confusing me and I don't have any idea about how to solve it.