Oracle on cascade set null




















Activity Go To my previous tutorial on foreign key and create parent authors and child books table with foreign key and after creating them try to drop the parent authors table and see what will happen. This means that you are allowed to update the rows in the parent table however you cannot delete rows from the parent table.

This default behavior is called Restrict rule. Definitely not. In Oracle Database you get two referential actions to override the restrict rule and change the default behavior of foreign key. These two referential actions are —.

On Delete Set Null clause sets all the records of the column which is defined as a foreign key in the child table to Null if the corresponding record in the parent table is deleted. For the demonstration we will be using the same tables which we created in the previous tutorial. We specify the clause On Delete Set Null along with the definition of foreign key and as mentioned above, we define a foreign key in the child table.

Thus now we need a child table. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Linked 0. Related Hot Network Questions. Question feed. I took the id column from other table reference table If I drop the reference table what will happen to the newly created table. Your question is ambiguous. Add a comment. Active Oldest Votes. SRamPrakash: don't ask new questions in comments. Klick on the Ask Question button instead. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.



0コメント

  • 1000 / 1000