While testing if exists records on a proxy table in SAP IQ (the original table is in SAP ASE) the exists condition return the erroneous response.
See example below.
Any idea how to solve this?
Note, for those of you that want to reproduce, the dpStatus column is defined as smallint.
I'm using the .../DataAccess64/ODBC/lib/libsybdrvodb.so driver for the configuration if the remote server.
SAP IQ 15.2 ESD2
select distinct dpStatus from DBA.AdwProcess_proxy
dpStatus
-----------
0
4
5
9
4 record(s) selected [Fetch MetaData: 0ms] [Fetch Data: 0ms]
[Executed: 10/06/2014 4:28:30 PM] [Execution: 7s]
if (select count(dpStatus)
from DBA.AdwProcess_proxy
where dpStatus = 9) > 0
print 'Found'
else print 'Not Found'
Command was executed successfully
Warnings: --->
W (1): Found
<---
[Executed: 10/06/2014 4:30:45 PM] [Execution: 624ms]
if exists (select dpStatus
from DBA.AdwProcess_proxy
where dpStatus = 9)
print 'Found'
else print 'Not Found'
Command was executed successfully
Warnings: --->
W (1): Found
<---
[Executed: 10/06/2014 4:31:58 PM] [Execution: 593ms]
SAP IQ 16.0 SP8
select distinct dpStatus from DBA.AdwProcess_proxy
if (select count(dpStatus)
from DBA.AdwProcess_proxy
where dpStatus = 9) > 0
print 'Found'
else print 'Not Found'
Command was executed successfully
Warnings: --->
W (1): Found
<---
[Executed: 10/06/2014 4:33:32 PM] [Execution: 265ms]
if exists (select dpStatus
from DBA.AdwProcess_proxy
where dpStatus = 9)
print 'Found'
else print 'Not Found'
Command was executed successfully
Warnings: --->
W (1): Not Found
<---
[Executed: 10/06/2014 4:34:07 PM] [Execution: 16ms]