Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many UNIONs can i use in a single query?

Status
Not open for further replies.

daYorkie

Programmer
Jun 8, 2003
7
GB
Hi all,

I have a rather long query selecting items out of various unconnected areas of the DB. I have a working query including 20 UNIONs but when I add the 21st I am presented with a syntax error DB Errorcode=-201 (standard general syntax code)

each statement in isolation runs fine.

Have i hit a hard limit on number of union allowed? Or is this something i may be able to work around / reconfigure? Appreciate I'll probably be advised to write a better query but the data really is unconnected so I do not see a solution to get all the data onto a single report without using UNION.

Thankyou
 
I have never heard of such a limit. Unfortunately because of the different versions of Informix and the tools to build the queries, it would be difficult to be for sure. I would suggest breaking down the query into a smaller query and testing (particularly the area you are having an issue with).
 
thanks kray - I will run each segment of query and put output of each into a new temp table and select everything from that once done. Pain but'll do the job and avoid the unions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top