wood burning stoves 2.0*
The moose likes Oracle/OAS and the fly likes Deleting parent->child with inverse foreignkey Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Deleting parent->child with inverse foreignkey" Watch "Deleting parent->child with inverse foreignkey" New topic
Author

Deleting parent->child with inverse foreignkey

Mads jacobsen
Greenhorn

Joined: Nov 20, 2008
Posts: 7
Hi all

i've run into a small problem.

It might be that the solution is obvious, and i just don't see it.

I have a bunch on tables.



I wish to delete a row from the PARENT table, and each corresponding rows from the 3 CHILDX tables.

If the relationship was the other way around, i would just smack a ON DELETE CASCADE constraint on, and live happily ever after.

Does anyone have a suggestion which could point me in the right direction?

I know i essentially have 3 parents and 1 child here, and that the best solution would probably be to inverse the relationship, but this is unfortunatly not an option for me.

btw this is on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 if that matters

Thank you in advance for your time.
Mads jacobsen
Greenhorn

Joined: Nov 20, 2008
Posts: 7
In the end i solved this using a stored procedure.

Its not really how i wanted to go around it, and from a maintanance point of view its awefull, but given that the structure had a great amount of tables i saw no other choice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deleting parent->child with inverse foreignkey