Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to specify cascade delete when CREATE/Alter a table?

Re: How to specify cascade delete when CREATE/Alter a table?

From: Frances Edelstein <fran_at_rbsbooks.com>
Date: Fri, 27 Aug 1999 20:52:37 -0400
Message-ID: <7q7bv3$dnl@enews1.newsguy.com>


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



In article <37C6F076.7888_at_wt.infi.net>, Weiming He <weiming_at_wt.infi.net> wrote:

>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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US