Ggf. wird ein Fullselect beim Set nicht unterstützt.
Eine Set-Anweisung entspricht einem skalaren Subselect und da ist With auch nicht erlaubt.
Aber dies geht wohl ebenso:
Code:
C/exec-sql
C+ with a as (select xxkey1, xxkey2, xxkey3
C+ from xxfile where xxma = 14073
C+ and xxan = 0 and xxstat = 2)
C+ select count(*) into :Z
c+ from(
C+ select yypool from yyfile
C+ where yyma=14073 AND yyAN=0
C+ AND (yykey1, yykey2, yykey3) in(
C+ select xxkey1, xxkey2, xxkey3 from a)
C+ and yymk*1000+yymst <> 999997
C+ group by yypool) as v
C/end exec
Bookmarks