Home » SQL & PL/SQL » SQL & PL/SQL » delete multiple tables (oracle 11g)
delete multiple tables [message #318967] Thu, 08 May 2008 09:44 Go to next message
guusz
Messages: 1
Registered: May 2008
Location: The Netherlands
Junior Member
I want to delete rows from multiple tables.

5 tables are involved:

bio_bedr (clus_id)
bio_bron (bedr_id, bio_id)
bio_clus (clus_id)
bio_loc (clus_id, bio_id)
bio_ubi (bedr_id)

I began with the following statement:

delete from gls_bio_clus, gls_bio_bedr, gls_bio_loc
where clus_id in ('C0546017239','C0546017247','C0546017440','C0546017486',
'C0546017582','C0546017786','C0546018237','C0546018297','C0546018350',
'C0546018855','C0546018972','C0546019074','C0546018997','C0546019036',
'C0546019128','C0546019145','C0546019352','C0546019364','C0546019408',
'C0546019413', 'C0546019428','C0546019633','C0546019485','C0546019642',
'C0546019691','C0546019819','C0546019971','C0546020027','C0546020092',
'C0546020141','C0546020181','C0546020223');

However this statement doesn't work. As I now know is it not possible to delete multiple tables with a single delete statement.

Please help, i'm fairly new on this so please reply in plain and simple english!
Re: delete multiple tables [message #318971 is a reply to message #318967] Thu, 08 May 2008 09:56 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
split the statements something like this.

delete from <table_a> where <condition>;
delete from <table_b> where <condition>;
delete from <table_c> where <condition>;


Regards

Raj
Re: delete multiple tables [message #319017 is a reply to message #318967] Thu, 08 May 2008 13:41 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
If you are going to be working with SQL then you might also want to look at something like this:

SQL for Dummies 3rd Edition (Paperback)

Notice in particular:

Quote:
17 used & new from $0.25


3$ for shipping...

and for the record I am not suggesting you are a Dummy, only that this is a good book for begginers.

Kevin
Previous Topic: SQL PLUS query result in Horizantal way
Next Topic: DML Statement in Function
Goto Forum:
  


Current Time: Sat Dec 03 06:01:48 CST 2016

Total time taken to generate the page: 0.09039 seconds