The SQL run via the load rule understands my subvars. The load rule SQL looks like this:
AND (('1' = '&IncSpanYr' --IF THE PERIODS SPAN YEARS
AND (('12' = '&CurMoNm' --IN JUNE LOOK INTO NEXT YEAR PERIOD 1
AND ((A.FISCAL_YEAR = '&CurYrNm' AND A.ACCOUNTING_PERIOD IN ('&PriMoNm', '&CurMoNm'))
This turns into:
AND (('1' = '1' --IF THE PERIODS SPAN YEARS
AND (('12' = '12' --IN JUNE LOOK INTO NEXT YEAR PERIOD 1
AND ((A.FISCAL_YEAR = '2014' AND A.ACCOUNTING_PERIOD IN ('2', '3'))
My issue is getting a dump of all that data that the SQL is pulling. I don't see a way to do that in the import database command. A separate job on the SQL side (like SSIS) could pull the data, but can't access the subvars easily. Does that make sense? Or did I misunderstand your suggestion?
What I was saying was in your script add another maxl statement which will which pull those subvars
display variable IncSpanYr;
spool the output to a file and then you can make use of OS scripts to read the values of those.
Create the exact same sql and then replace IncSpanYr with the value from Essbase.