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: question on delete statement

Re: question on delete statement

From: FC <flavio_at_tin.it>
Date: Fri, 20 Jun 2003 18:26:45 GMT
Message-ID: <FlIIa.217676$g92.4523896@news2.tin.it>

"Anurag Varma" <avarmadba.skipthis_at_yahoo.com> wrote in message news:2pGIa.1281$hI1.1274_at_nwrddc01.gnilink.net...

>
> It seems to delete the rows of the table mentioned first in the from
clause
> of the select statement.
> The tables should be joined on their PK's!
>

It is not necessary that both tables are joined on their PKs. If only one column is primary key, the records will be deleted from the table where the joined column is not primary key, no matter what is the order of the tables in the FROM clause.
I suppose this is what Oracle means by "key preserve" rule.

On the other hand, if both columns are pk, it's true what you said, the order matters.

I'd dare to summarise the rule as follows: in a "one-to-many" relationship, it's always the many that gets deleted (or updated).

Bye,
Flavio Received on Fri Jun 20 2003 - 13:26:45 CDT

Original text of this message

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