Home » SQL & PL/SQL » SQL & PL/SQL » tbl with two foreign keys
tbl with two foreign keys [message #222052] Thu, 01 March 2007 09:34 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
I created a table which has two colums and the two columns are foreign keys.
So this table has two parent tables.
If I delete record in one parent table will the row in child gets deleted or what would happen ?

In general If I have a table with several parent tables and one row in deleted from one parent table how would delete on cascade behave .


Re: tbl with two foreign keys [message #222054 is a reply to message #222052] Thu, 01 March 2007 09:39 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Why didn't you just try it? Then you'd know for sure. As it is, you'll just have to take the word of some totally unknown stranger for it, and trust that they're not maliciously deceiving you....

If the foreign keys are set to On Delete Cascade then a delete from any of the parent tables will delete all the children for that primary key value.
Previous Topic: Insert multiple Picture in a table
Next Topic: PLS-00172: string literal too long
Goto Forum:
  


Current Time: Mon Dec 05 15:18:27 CST 2016

Total time taken to generate the page: 0.09036 seconds