I have a script that executes some SQL that the return is then loaded into a script level variable.
The returned values are themselves insert statements that I then tell BODS to run. The insert statements themselves contain script level variables that when ran receive 0 instead of the proper values in the variables.
$rule_sql = sql('uc_audit',
'select rule_metric
from load_validation_rule_ec_var
where rule_id =[$min_rule] and job_id = [$job_id]');
sql('uc_dwse', ''[$rule_sql]');
/*which runs the following code
insert into uc_audit.dbo.Load_Rule_Results
select [$min_rule], [$job_id], [$load_id], count(1), max(snapst_dt], max(members_skey), null, null, getdate()
from dwse_members
where member_nbr is null and members_skey <> -1
*/
It substitutes 0 for the variables which are script level.
Any thoughts would be appreciated.