Xref: alice comp.databases.oracle.misc:22515
Path: alice!news-feed.fnsi.net!news.maxwell.syr.edu!news.he.net!news.mhpcc.edu!news.hpu.edu
Newsgroups: comp.databases.oracle.misc
Date: Wed, 11 Nov 1998 15:29:40 -1000
Message-ID: <F42CB9DBDC42D211B39F00AA00AF3282022273EA@Keiki.Hpu.Edu>
Reply-To: "Gene Plagge" <gplagge@hotmailc.om>
From: "Gene Plagge" <gplagge@hotmail.com>
References: <364367C4.26DCB9C2@home.com>
Subject: Re: Create Table question
Lines: 42
Organization: WorldxChange, Inc.
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4

Hi, Teresa,

Oracle doesn't support an "on update cascade" feature in it's foreign key
constraints. This is mainly because Oracle assumes that we DBA's are going
to design normalized tables using primary keys that are not going to be
updated.

In your case, that means that your COURSE table should have a primary key
that is not going to be modified; for instance, course_id. The SECTION table
should reference that non-modifiable field in its foreign key. Updates made
in the COURSE table would be to the other fields, and updating the SECTION
table's course_id would not be necessary.


Hope this helps,

Gene Plagge


Teresa Mah wrote in message <364367C4.26DCB9C2@home.com>...
>Hi,
>
>I'm having problems with the following create table statement:
>
>create table section
>( dept char(4) not null,
>          . . .
>  foreign key (dept, course#) references course
>                                    on delete cascade
>                                    on update cascade )
>
>The system allows me to write one "on" clause, but not both.  For
>example, I can do "on delete cascade" only, but not "on delete cascade
>on update cascade".
>
>Does anyone know the right syntax for specifying multiple actions?
>
>Thank you very much. Your help would be greatly appreciated.
>
>Teresa


