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

Maximum number of 'UNION' statements


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Wed Mar 28, 2007 1:08 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top