Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question on delete statement
"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