简体   繁体   中英

Union all in WebFocus-level

How to solve such problem in WebFocus

SQL SQLSYB PREPARE SQLOUT FOR
--big sql-query first
UNION ALL
--big sql-query second
ORDER BY 1,2,3
END

Gives error message in a customer server "statement size or complexity exceed server limits". If i use such

SQL SQLSYB PREPARE SQLOUT1 FOR
--big sql-query first
END

and

SQL SQLSYB PREPARE SQLOUT2 FOR
--big sql-query second
END

that how to use like

"SQLOUT = SQLOUT1 union all SQLOUT2 order by 1,2,3"??

Thanks

While I would be concerned about the error message that you are getting, without more details, I'm not sure how to address that part of the issue. Also, I have worked with sybase in the past either.

However, you could run the two statements separately, and then use MORE to do the union.

SQL SQLSYB PREPARE SQLOUT1 FOR
--big sql-query first
END
TABLE FILE SQLOUT1
PRINT *
ON TABLE HOLD AS HOLDA 
END

SQL SQLSYB PREPARE SQLOUT2 FOR
--big sql-query second
END
TABLE FILE SQLOUT2
PRINT*
ON TABLE HOLD AS HOLDB
END

TABLE FILE HOLDA
PRINT *
ON TABLE HOLD AS HOLDC
MORE
FILE HOLDA
END

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM