Home » SQL & PL/SQL » SQL & PL/SQL » ON DELETE CASCADE and ON UPDATE CASCADE (oracle 10g R2, win xp)
ON DELETE CASCADE and ON UPDATE CASCADE [message #385469] Mon, 09 February 2009 18:29 Go to next message
dandeliondream
Messages: 12
Registered: February 2009
Junior Member
Please explain the difference between ON DELETE CASCADE and ON UPDATE CASCADE? I'm getting a little confused.
Re: ON DELETE CASCADE and ON UPDATE CASCADE [message #385475 is a reply to message #385469] Mon, 09 February 2009 18:46 Go to previous messageGo to next message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/toc.htm

Re: ON DELETE CASCADE and ON UPDATE CASCADE [message #385482 is a reply to message #385475] Mon, 09 February 2009 19:56 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
ON DELETE CASCADE means when you delete the parent of a foreign key relationship, the chilren are deleted too. It is supported natively by Oracle - you can specify it when you create a foreign key constraints

ON UPDATE CASCADE means that when you update the PRIMARY KEY on the parent of a foreign key relationship, the FOREIGN KEY of the child is also updated. It is NOT supported natively by Oracle - you must code it yourself using triggers.

Ross Leishman
Re: ON DELETE CASCADE and ON UPDATE CASCADE [message #385670 is a reply to message #385475] Tue, 10 February 2009 08:33 Go to previous messageGo to next message
dandeliondream
Messages: 12
Registered: February 2009
Junior Member
I'm new to this forum so please beaar with me for the time being. I will try my best to follow the posting guidelines.
Re: ON DELETE CASCADE and ON UPDATE CASCADE [message #385671 is a reply to message #385482] Tue, 10 February 2009 08:36 Go to previous message
dandeliondream
Messages: 12
Registered: February 2009
Junior Member
rleishman wrote on Mon, 09 February 2009 19:56
ON DELETE CASCADE means when you delete the parent of a foreign key relationship, the chilren are deleted too. It is supported natively by Oracle - you can specify it when you create a foreign key constraints

ON UPDATE CASCADE means that when you update the PRIMARY KEY on the parent of a foreign key relationship, the FOREIGN KEY of the child is also updated. It is NOT supported natively by Oracle - you must code it yourself using triggers.

Ross Leishman


Thanks for the explanation. I think i have a better understanding now.
Previous Topic: getting row from both transaction tables
Next Topic: Materialized views
Goto Forum:
  


Current Time: Tue Dec 06 02:40:00 CST 2016

Total time taken to generate the page: 0.25655 seconds