SAP Knowledge Base Article - Preview

2574676 - Query with UNION ALL, constant and count() returns inconsistent data - SAP IQ

Symptom

The following query returns a different number of rows each time it is run.

select newevent, count(*) from 
(SELECT 'RouteExternal' as NewEvent, * FROM table1
union all
SELECT 'RouteExternal2' as NewEvent, * FROM table1) as test
group by newevent

The group by means there should be 2 rows returned, but the number of rows varies from 4 up to 30 or more and is never the same twice in a row. The values of "NewEvent" are full of hex characters, strings like "buffers", "eExter", "outeEx", and so on.

newevent,count()
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',6568176
'\x00\x00\x00\x00\x00\x00\x00\x00(ç}À\x85\x7f',776
'èâ}À\x85\x7f\x00\x00(ç}À\x85\x7f',2309
'èâ}À\x85\x7f\x00\x00ernal2',8260
'\x00\x00\x00\x00\x00\x00\x00\x00ernal2',2023702
'RouteExternal',38954111
'RouteExternal2',30224253
'\x00\x00\x00\x00\x00\x00xt\x00\x00\x00\x00\x00\x00',6455
'\x00\x00\x00\x00\x00\x00xternal2',120180

If any of the 3 factors (the constant, the count or the union all) is removed, the query works.


Read more...

Environment

SAP IQ 16

Product

SAP Sybase IQ 15.4

Keywords

CR812231, CR 812231 CR#8122131, , KBA , BC-SYB-IQ , Sybase IQ , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.