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

Home -> Community -> Usenet -> c.d.o.server -> Re: please help

Re: please help

From: Andreas Schlager <aschlager_at_kaindl.com>
Date: Tue, 15 Dec 1998 10:24:03 GMT
Message-ID: <3676384b.13627264@news.salzburg.co.at>


On Tue, 15 Dec 1998 10:41:07 -0800, Steven <koh_cc_at_pacific.net.sg> wrote:

>hi,
>
> l have two exiting Parent and Child tables.
>
> May l know what's the actual command for me to use at SQL
>worksheet,
> in order to make them "on cascade delete" ?
>
> Purpose: when l deleted the parent table's record, the child
>table's record
> will be deleted as well.
>
>

Hi, Steven,

try the following:

ALTER TABLE child_table

ADD	(
	FOREIGN KEY (filed1)
		REFERENCES parent_table
		ON DELETE CASCADE
	)

;

In this example the field 'field1' must be present also in the parent-table.

Have a nice day!

Andreas Schlager
aschlager_at_kaindl.com Received on Tue Dec 15 1998 - 04:24:03 CST

Original text of this message

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