Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Maximum number of 'UNION' statements

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
hernikiten

New User


Joined: 08 Apr 2005
Posts: 23
Location: india

PostPosted: Wed Mar 28, 2007 12:10 am    Post subject: Maximum number of 'UNION' statements
Reply with quote

Hi,

What's the maximum number of UNION statements allowed in a single SQL querry(if its treat as a single query as a whole).

Thanks
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Mar 28, 2007 1:08 am    Post subject:
Reply with quote

Maybe 4000 bytes worth of columns or maybe 224 subquerys...see if you can dig up an answer in the Appendix A. Limits in DB2 UDB for z/OS
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 28, 2007 12:53 pm    Post subject:
Reply with quote

4000 BYTES, if the query has to sort the data to put the results.

In other words, you can have any no of unions but the column length listed in the SQL query should not exceed 400 bytes. This limitation may not be applicable if you are using UNION ALL.

In general,
MAX SQL statement length for V7 was 32KB.
In V8 it is extended to 2 MB.

If you are using UNION ALL the above sql statement length limitations may be applicable.
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 Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts CPU time Vs Number of records Nileshkul JCL & VSAM 5 Mon May 09, 2016 4:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us