When we run the following query it produces a syntax error saying that:
Command has been aborted.
Number (102) Severity (15) State (1) Server (MYSERVER Incorrect syntax near ')'.
(42000)
select distinct ems_sa_id
from ems_shadow_account s
where ems_sa_isOld=0
and exists (select *
from PRINCIPAL_PARTY
where prp_cli_branch_number="xxx"
and prp_cli_account_number="YYYYYYY"
and prp_managed_ind != '06'
and (
(prp_managed_ind like '0%' or prp_managed_ind='10')
or
(prp_managed_ind = 'N' AND prp_discr_ind = 'A' and prp_trading_auth = 'I')
)
)
select @@version
Adaptive Server Enterprise/12.5.2/EBF 11798/P/NT (IX86)/OS 4.0/ase1252/1831/32-bit/OPT/Fri Apr 09 04:15:03 2004
The sub-query by itself works
Principal_party is a proxy table pointing to a table on a ASE version 15.3.
Please help me understand what is wrong.