Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleting parent->child with inverse foreignkey

 
Mads jacobsen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic