|
What I don't understand, is that the following statement does work: c/exec sql c+ Declare CR1 cursor for c+ Select vendor, c+ vdname, c+ count(slip) c+ From ( c+ Select fdvdcd as vendor, c+ vdvnam as vdname, c+ rfslip as slip c+ From rflog, fldmst, isfile, vdmast c+ Where (rfuser = :k1user) and c+ (rftype = :type) and c+ date(rftrdt) = date(:k1date) and c+ isslip = rfslip and c+ fdflno = isflno and c+ fdlnno = isflln and c+ vdvdcd = fdvdcd c+ Union c+ Select fdvdcd as vendor, c+ vdvnam as vdname, c+ rfslip as slip c+ From rflog, fldmst, bofile, vdmast c+ Where (rfuser = :k1user) and c+ (rftype = :type) and c+ rftype <> 'BI' and c+ date(rftrdt) = date(:k1date) and c+ boslip = rfslip and c+ fdflno = boflno and c+ fdlnno = boflln and c+ vdvdcd = fdvdcd c+ ) as table1 c+ Group by vendor, c+ vdname c+ Order by vendor, c+ vdname c/end-exec The difference might be that I'm now at a new client on V5R1M0, and the above was made on V5R3M0... Or is this something completely different? Thanks, Peter Colpaert Application Developer Massive - Kontich, Belgium ----- Real developers never document. If it was hard to write, it should be hard to understand. ----- R Bruce Hoffman <bruce.hoffman@xxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 03/12/2004 13:36 Please respond to RPG programming on the AS400 / iSeries To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc: Subject: Re: Strange SQL error Well, if I'm not mistaken, selects in a where clause must be sub-selects. By definition, any select with a union operator is a full-select. Part of the language definition.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.