Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> UPDATE catch-22 - help!
Two tables:
PAYMENT (transactionID, PersonID, amount, paymentdate) CREDIT (creditID, transactionID, PersonID, CreditPersonID)
The credit table logs people who get credit for payments made by other people. A credit record can only be created for existing Payments and this is enforced by a constraint.
The two tables are linked by a primary key that consists of the transactionID and the PersonID
If I try to update the PersonID on the PAYMENT table, I get a 'child record found) constraint violation.
If I try to update the PersonID first on the PAYMENT table, I get a 'parent key not found' constraint violation because a PAYMENT record with that combination of transactionID+PersonID does not yet exist.
How do I UPDATE the PersonID?
Joost Ouwerkerk
Toronto, Canada
Received on Thu Dec 03 1998 - 11:51:54 CST