Run Script Examples: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
(403051)
 
No edit summary
Line 1: Line 1:
This page contains script examples for the [[Supported_QPR_ProcessAnalyzer_Commands_in_Scripts#--.23Run|Run]] script command.
This page contains script examples for the [[QPR ProcessAnalyzer Scripting Commands#--.23Run|Run]] script command.


In the following example, the script gets data from two data tables and passes that data to the script with Id equal to <ScriptId>.  
In the following example, the script gets data from two data tables and passes that data to the script with Id equal to <ScriptId>.  

Revision as of 07:06, 7 February 2018

This page contains script examples for the Run script command.

In the following example, the script gets data from two data tables and passes that data to the script with Id equal to <ScriptId>.

(SELECT 'AnalysisType', '18') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'DataTableId', '<DataTableId_1>') UNION ALL
(SELECT 'TargetTable', '#DataTable1')
--#GetAnalysis

(SELECT 'AnalysisType', '18') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'DataTableId', '<DataTableId_2>') UNION ALL
(SELECT 'TargetTable', '#DataTable2')
--#GetAnalysis

(SELECT 'ScriptId', '<ScriptId>')
SELECT * FROM #DataTable1;
SELECT * FROM #DataTable2;
--#Run

Then it runs that script with the following parameters: the number of arguments is 2 (that is, @_Argv=2). #_Arg1 takes data from the <DataTableId_1> data table and #_Arg2 from the <DataTableId_2> data table.

print 'Number of arguments: ' + cast(@_Argv as varchar(100));

SELECT * from #_Arg1;
(SELECT 'MaximumCount', '0')
--#ShowReport

SELECT * from #_Arg2;
(SELECT 'MaximumCount', '0')
--#ShowReport