Hi,
I am new to DB2 and in a new job and in need of urgent help. Here we have about 100 queries (SQL) that have been manually executed to retrieve totals from different tables and post it to Excel spreadsheet. Is there any way I can create a shell script as a wrapper and execute these queries and create a report all at one time instead of running the queries 100 times? Any help is appreciated.
Here are some sample queries that I would like to use in unix script:
SELECT MSR_PRD_ID , COUNT(*) COUNT, SUM(SHDW_BAL) SHDW_BAL
FROM RDR.AR_TVR_PRFL WHERE SRC_STM_ID=7 GROUP BY MSR_PRD_ID
SELECT count(*), a.src_stm_id, SUM(SHD_AMT) SUM_SHD_AMT FROM
RDR.AR_AVY_SCHD A, RDR.AR B WHERE a.src_stm_id=7 and
A.AR_ID=B.AR_ID
AND AR_LCS_TP_ID<>(select cl_id from rdr.cl where src_stm_id=7 and cl_code = 'PURGED')
group by a.src_stm_id;
SELECT MSR_PRD_ID, SUM(COFF_AMT) SUM_COFF_AMT,COUNT(*) COUNT
FROM RDR.AR_DLQ_PRFL WHERE SRC_STM_ID=7 GROUP BY MSR_PRD_ID
Thanks in advance,
GG