• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deleting parent->child with inverse foreignkey

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic