Can I do this?
Posted in 2011
OS: RHEL 5
IDS: 11.1FC3
I have several SPL functions that return detail info (multi row) using 2
dates as input parameters. I would like to use the already created
routines in summary SPL functions using the TABLE function for running
the routine. This works fine when I specify the dates running it as
just a simple select statement, but when I put it into a foreach loop
within the SPL, I get a -217 error about the input parameters not being
part of the query.
SELECT
unnamed_col_3,unnamed_col_7,count(unnamed_col_2),sum(unnamed_col_33),sum
(unnamed_col_21),sum(unnamed_col_22),
sum(unnamed_col_23),sum(unnamed_col_24),sum(unnamed_col_25),sum(unnamed_
col_26),
sum(unnamed_col_27),sum(unnamed_col_28),sum(unnamed_col_30),sum(unnamed_
col_31)
FROM TABLE( FUNCTION Filings('1/1/2011','1/31/2011'))
GROUP BY 1,2
This works, but
Create function FilingsSummary(date as p_StartDate,date as p_EndDate)....
.
.
FOREACH
SELECT
unnamed_col_3,unnamed_col_7,count(unnamed_col_2),sum(unnamed_col_33),sum
(unnamed_col_21),sum(unnamed_col_22),
sum(unnamed_col_23),sum(unnamed_col_24),sum(unnamed_col_25),sum(unnamed_
col_26),
sum(unnamed_col_27),sum(unnamed_col_28),sum(unnamed_col_30),sum(unnamed_
col_31)
INTO variables...
FROM TABLE( FUNCTION Filings(p_StartDate,p_EndDate))
GROUP BY 1,2
.
. function processing
.
Doesn't work.
Is it possible to make something like this work? I have many detail
functions that I would like to create summary functions around without
having to maintain the main queries twice. The detail functions are
more than simple queries so I would have to put all the post select
processing into the summary functions as well and then remember to
update both if anything changes in the logic.
TIA,
Randy