Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How To Update 3 tables Simultaneouly through one query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How To Update 3 tables Simultaneouly through one query
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

Site Director


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

PostPosted: Mon Jul 18, 2011 7:58 pm    Post subject:
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    Post subject: Reply to: How To Update 3 tables Simultaneouly through one q
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: 1777
Location: Bloomington, IL

PostPosted: Mon Jul 18, 2011 8:37 pm    Post subject: Re: Reply to: How To Update 3 tables Simultaneouly through o
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

Site Director


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

PostPosted: Mon Jul 18, 2011 8:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us