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: simple sql question - delete

Re: simple sql question - delete

From: <fitzjarrell_at_cox.net>
Date: 13 May 2005 13:50:29 -0700
Message-ID: <1116017429.780919.112010@o13g2000cwo.googlegroups.com>


Comments embedded.
Ian wrote:
> Hi,
> I have a number of tables which I wany to delete rows based on a
condition.
> However, one or two of the tables may have multiple rows.
> eg DELETE TABLE1 TABLE2 TABLE3 TABLE4
> WHERE EMPID = 'ABCD1234'
> The problem is that table1 and table3 have multiple rows that match
the
> where condition - which causes an error.
>

You're apparently using MySQL as only this product allows such a DELETE statement to run. Oracle will error on the multiple tables listed after DELETE. Multiple rows has nothing to do with that.

> Can anyone please suggest the most efficient sytntax for doing this.
> I can always do seperate delete sql statements for each table - which
works.
> But is there a more efficient way? I woullike to keep the number of
> statements to a minimum as the potentially could be a large number of
tables
> effected.
> regards
>

Use multiple delete statements, as that's the only way Oracle will allow you to process such a transaction. That is IF you're actually using Oracle. Which I seriously doubt. And, didn't you ask this in the IRC channels a while back, in the same text? You were told the same answer there.

> ps rchange the ZZ to au if direct reply in email

David Fitzjarrell Received on Fri May 13 2005 - 15:50:29 CDT

Original text of this message

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