How can I - excuse my ignorance - run a select query from a module?
I want to run the query a couple of times on different database libraries (on a AS400 through ODBC). It works as a seprate query, but I want to run it from a module on different tables.
query:
SELECT ANP01D_ANVS.VSNR, ANP01D_ANVS.VSRCSTCD, (SELECT COUNT(UNNR) AS Aantal FROM ANP01D_ANUN where ANP01D_ANUN.VSNR=ANP01D_ANVS.VSNR) AS [Aantal Units]
FROM ANP01D_ANVS, ANP01D_ANUN
WHERE (((ANP01D_ANVS.VSRCSTCD)=1) AND (((SELECT COUNT(UNNR) AS Aantal FROM ANP01D_ANUN where ANP01D_ANUN.VSNR=ANP01D_ANVS.VSNR))>0));
Where 01, could also be 45 or 95, depending on the library I am accessing.
Thanks in advance.
Bernd
I want to run the query a couple of times on different database libraries (on a AS400 through ODBC). It works as a seprate query, but I want to run it from a module on different tables.
query:
SELECT ANP01D_ANVS.VSNR, ANP01D_ANVS.VSRCSTCD, (SELECT COUNT(UNNR) AS Aantal FROM ANP01D_ANUN where ANP01D_ANUN.VSNR=ANP01D_ANVS.VSNR) AS [Aantal Units]
FROM ANP01D_ANVS, ANP01D_ANUN
WHERE (((ANP01D_ANVS.VSRCSTCD)=1) AND (((SELECT COUNT(UNNR) AS Aantal FROM ANP01D_ANUN where ANP01D_ANUN.VSNR=ANP01D_ANVS.VSNR))>0));
Where 01, could also be 45 or 95, depending on the library I am accessing.
Thanks in advance.
Bernd