Subject RE: [firebird-support] UNION not allowed in EXISTS clause?
Author Rick DeBay
Does anyone know where I can start hunting for answers to this?

-----Original Message-----
From: Rick DeBay
Sent: Friday, July 09, 2004 11:53 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] UNION not allowed in EXISTS clause?

The select in the not-exists clause runs fine on its own. When it's
part of an exists or not-exists clause, it fails with the given error.

INSERT INTO CLAIMAUDIT (RXCLAIMNBR,RXCLAIMSEQ,AUDITSTATUS,REASON)
SELECT DISTINCT 5,123,0,'TEST'
FROM CLAIMAUDIT
WHERE NOT EXISTS
(SELECT DATESBM FROM CLAIMSPAIDREVERSED WHERE RXCLAIMNBR='5' AND
CLMSEQNBR<=123 and CLAIMSTS='X'
UNION
SELECT CHANGED FROM CLAIMAUDIT WHERE RXCLAIMNBR=5 AND
RXCLAIMSEQ=123 AND REASON='TEST')

Dynamic SQL Error SQL error code = -104 Token unknown - line 6, char 6
UNION

Rick DeBay
Senior Software Developer
RxStrategies.net