-
trigger for update
When using "ON DELETE CASCADE " data in child tables automatically removed when parent table gets deteted
How to write trigger for update .I has follwed as for deleting cascade
create table n1(no number,name varchar2(10),constraint n_k primary key(no));
create table n2 (loc varchar2(10),no references n1(no) on delete cascade);
SQL> select * from n2;
LOC NO
---------- ----------
delhi 1
SQL> select * from n1;
NO NAME
---------- ----------
1 mmm
2 nnn
3 xxx
SQL> delete n1 where no=1;
1 row deleted.
SQL> select * from n2;
no rows selected
Thanks in advance
mohan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|