| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: question on delete statement
Anurag Varma wrote:
> I agree
> ... Jusung's reply summarizes this quite nicely.
>
> Anurag
>
> "FC" <flavio_at_tin.it> wrote in message
> news:FlIIa.217676$g92.4523896_at_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
> >
> >
> >
Look at the standard syntax for updating tables with nested tables and objects. Update and Delete against a SELECT is the norm.
-- Daniel Morgan http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Fri Jun 20 2003 - 14:54:47 CDT
![]() |
![]() |