Cascade Update !!! [message #372998] |
Wed, 21 March 2001 17:04 |
Manoj
Messages: 101 Registered: August 2000
|
Senior Member |
|
|
Hi,
This question is asked many times , still I need more response. My task is to Update Master table's Primary key, and the detail tables are updated automatically!
But I wonder, Is there any constraint named 'On update cascade'
I know there is one for delete but what about Update
---
SQL> create table x2 (no number references master(no) on update cascade);
create table x2 (no number references master(no) on update cascade)
*
ERROR at line 1:
ORA-00905: missing keyword
---
would you mind to clarify.
Thanks
Manoj !
|
|
|
Re: Cascade Update !!! [message #373000 is a reply to message #372998] |
Wed, 21 March 2001 19:03 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
No there is not, you need to manually do it (create triggers). Sounds like you will hit the mutating table problem too, so then you need packages etc to overcome that.
You say "Update Master table's Primary key". That shouldn't be the case. By definition a PK *never* changes. If your chosen PK needs updating, it would be much better to have a dataless PK (i.e. just a plain sequence number).
|
|
|
Re: Cascade Update !!! [message #373004 is a reply to message #372998] |
Wed, 21 March 2001 22:59 |
Thirumalai and Prakash
Messages: 23 Registered: March 2001
|
Junior Member |
|
|
There is nothing called On Update Cascade. Usually trigger is also known as "OnUpdate Cascade".
But if u try to update the same Table using a trigger it will throw out an error "Mutating Table".
Regards
Prakash and Thirumalai
|
|
|