Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to specify cascade delete when CREATE/Alter a table?
Delete cascade belongs with the referential integrity section of the create
table statement.
For example:
create table b (
col1 integer primary key,
col2 integer references table a (col1) on delete cascade,
col3 integer);
If a record in table a is deleted ,
any records in table b will be deleted
where the value in b.col2 = the volue in a.col1 of its deleted record.
Take a look at the sample chapter of my tutorial on Oracle 7 concepts and
techniques,
called Learning Oracle Database Programming. It teaches the fundamentals of
referential ingegrity.
http://www.rbsbooks.com
Frances Edelstein
Relational Business Systems
fran_at_rbsbooks.com
>Hi all:
>
>I remember we can do cascading delete in Oracle. But I forgot how
>to specify in CREATE or ALTER command in SQL*PLUS? What the syntax it
>is?
>If someone knows, please pass me a hand. Thanks in advance.
>
>Weiming He
Received on Fri Aug 27 1999 - 19:52:37 CDT