Unanswered: store results of dynamic sql to temp table
I am using Sybase ASE15.x version. In my stored procedure I have basically 8 sql strings stored in different varchar variables. I have to perform a UNION of all the 8 queries. If I put up all these 8 queries joined by UNION in a single varchar variable and then try to execute the string I am facing problem since the sql query is longer than the max number of chars allowed in a varchar.
Can we split up the finalquery into parts and store the results of the parts in temporary tables and then perform a UNION on these temporary tables? If I do this i get an error.