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
 
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 INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm
No new posts Remove all Parenthetical Statements -... JayaprakashT DB2 2 Fri Apr 27, 2018 3:57 am
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm

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