IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How To Update 3 tables Simultaneouly through one query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ankur_bhargava

New User


Joined: 18 Jul 2011
Posts: 2
Location: India

PostPosted: Mon Jul 18, 2011 7:47 pm
Reply with quote

Hi All,

I have 3 separate queries to update fields in 3 different tables.But my requirement is, i want to update all 3 tables simultaneouly by single query.I tried to join 3 tables with a common field on all,and tried to update the fields on all 3 tables ( Fields are different in all tables ) .But it's not working.Anyone please help me on this. icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 18, 2011 7:58 pm
Reply with quote

Hello and welcome to the forum,

Do NOT post "it didn't work". . . This is a completely wasted post as it tells us nothing icon_sad.gif

If the columns are different in all 3 tables, how might there be a join - makes no sense icon_confused.gif

Why is there an issue with multiple queries to update multiple sets of unrelated data?
Back to top
View user's profile Send private message
Ankur_bhargava

New User


Joined: 18 Jul 2011
Posts: 2
Location: India

PostPosted: Mon Jul 18, 2011 8:34 pm
Reply with quote

Thanks for giving Reply,
But as per my thinking why to run 3 separate queries if possible to do the same work in single query.
I don't have any idea whether this is possible or not but just tried to get the best possible. ( can we use Temporary Table or Cursor to do the same )
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Jul 18, 2011 8:37 pm
Reply with quote

Ankur_bhargava wrote:

I don't have any idea whether this is possible or not but just tried to get the best possible.

So now that you've been told that it is not possible you'll devote your energies to more productive endeavors, yes?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 18, 2011 8:42 pm
Reply with quote

Hello,

Quote:
But as per my thinking why to run 3 separate queries if possible to do the same work in single query.
Suggest you totally change your thinking. . .

There is no good reason to do unrelated "things" in the same query. . .

Actually, there are good reasons (which should be obvious) NOT to do unrelated things in a query. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need to fetch data from so many DB2 t... DB2 9
Search our Forums:

Back to Top