MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete from Multiple tables using a single SQL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Tue Aug 01, 2006 10:06 pm    Post subject: Delete from Multiple tables using a single SQL Reply with quote

Hi,

I need to know if it possible to delete rows from multiple tables using a single sql? If so can some one post a sample query?

- Martin
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Wed Aug 02, 2006 1:44 am    Post subject: Reply with quote

Hello Martin,

no, a DELETE can be directed only to one table.
An exception is the definition of referential integrity rules with a cascading delete for the child table rows. But the use of that is limited to primary and secondary key connections between tables.

Why couldn't you use more than one SQL statement?

regards
Christian
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Wed Aug 02, 2006 1:55 am    Post subject: Reply with quote

Martin,

As CZerfas mentioned Delete applies to only one table only that is rows are deleted from one table.If u code Very Happy
Code:

DELETE FROM TABLEA TABLEB;

Delete will be applicable to only TABLEA only not to TABLEB.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group