GetExecution gets data from a database and returns an array in the format:
ExecutionResult_1_DataExtractName
ExecutionResult_1_ExecutionId
ExecutionResult_1_ParameterName
ExecutionResult_1_ParameterValue
ExecutionResult_1_UnitCode
FindParameter performs a loop over the returned array to find the appropriate value so it can be stored in its own variable for use later.
When I execute this I get the following error, any suggestions?
Code: Select all
Line: 36 - Repeat>{(%FoundParameter%="Yes") Or (%c%=%NumColumns%)} Not Found!
Code: Select all
Let>ConnectionString=someConnectionString
SRT>GetExecution
// Create SQL statement to execute
If>GetExecution_Var_1=
Let>SQL=EXEC MacroScheduler.Execution_Get
Else
Let>SQL=EXEC MacroScheduler.Execution_Get @UnitCode='%GetExecution_Var_1%'
EndIf
// Connect to database
Assigned>StagingOleDb,VariableAssigned
If>VariableAssigned=FALSE
DBConnect>ConnectionString,StagingOleDb
EndIf
// Execute SQL
DBQuery>StagingOleDb,SQL,ExecutionResult,NumRows,NumColumns,1
END>GetExecution
SRT>FindParameter
Let>r=0
Let>FoundParameter=No
Repeat>r
Let>r=r+1
Let>c=0
Repeat>c
Let>c=c+1
Let>ParameterName=ExecutionResult_%r%_ParameterName
If>ParameterName=FindParameter_Var_1
Let>ParameterValue=ExecutionResult_%r%_ParameterValue
Let>FoundParameter=Yes
EndIf
Until>{(%FoundParameter%="Yes") Or (%c%=%NumColumns%)}
Until>{(%FoundParameter%="Yes") Or (%r%=%NumRows%)}
END>FindParameter
GoSub>GetExecution
GoSub>FindParameter,Unit
If>FoundParameter=Yes
Let>Unit=ParameterValue
EndIf
GoSub>FindParameter,StartDate
If>FoundParameter=Yes
Let>StartDate=ParameterValue
EndIf