ImportDataTable Script Examples: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
(Undo revision 22691 by Ollvihe (talk))
Tag: Undo
No edit summary
 
Line 1: Line 1:
This page contains script examples for the [[SQL Scripting Commands#--.23ImportDataTable|ImportDataTable]] script command.
This page contains script examples for the [[SQL Scripting Commands#--.23ImportDataTable|ImportDataTable]] script command.


The following example will load data from a model and put it into the "AnalysisResult" table and then add that data to the "ExampleTable" data table.
The following example will load data from the "ExampleTable" data table in the "ExampleProject" project, put that data into the "CSV1" table and then show the contents of the "CSV" table. In effect, it shows the contents of the "ExampleTable" data table.
<pre>
<pre>
SELECT 'START'
(SELECT 'AnalysisType', '18') UNION ALL
--#WriteLog
(SELECT 'ProjectName', 'ExampleProject') UNION ALL
 
(SELECT 'AnalysisType', '6') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'FilterId', '3') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL  
(SELECT 'SelectedEventAttributes', '*') UNION ALL
(SELECT 'TargetTable', '#Result')  
(SELECT 'TargetTable', '#AnalysisResult')
--#GetAnalysis
--#GetAnalysis
SELECT 'DataLoaded'
--#WriteLog
SELECT count(*) from [#AnalysisResult]
--#WriteLog


(SELECT 'ProjectId', '1') UNION ALL
(SELECT 'ProjectId', '1') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL
(SELECT 'Append', '1')
(SELECT 'Append', '1')
(SELECT * FROM [#AnalysisResult])
(SELECT * FROM [#Result])
--#ImportDataTable
--#ImportDataTable
</pre>
</pre>
The following example will load data from the "ExampleTable" data table in the "ExampleProject" project, put that data into the "CSV1" table and then show the contents of the "CSV" table. In effect, it shows the contents of the "ExampleTable" data table.
<pre>
(SELECT 'AnalysisType', '18') UNION ALL
(SELECT 'ProjectName', 'ExampleProject') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL
(SELECT 'TargetTable', '#CSV1')
--#GetAnalysis
(SELECT * FROM #CSV1)
(SELECT 'Title', 'CSV Table') UNION ALL
(SELECT 'MaximumCount', '0')
--#ShowReport
</pre>


[[Category:Examples]]
[[Category:Examples]]

Latest revision as of 20:39, 8 March 2023

This page contains script examples for the ImportDataTable script command.

The following example will load data from the "ExampleTable" data table in the "ExampleProject" project, put that data into the "CSV1" table and then show the contents of the "CSV" table. In effect, it shows the contents of the "ExampleTable" data table.

(SELECT 'AnalysisType', '18') UNION ALL 
(SELECT 'ProjectName', 'ExampleProject') UNION ALL
(SELECT 'MaximumCount', '0') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL 
(SELECT 'TargetTable', '#Result') 
--#GetAnalysis

(SELECT 'ProjectId', '1') UNION ALL
(SELECT 'DataTableName', 'ExampleTable') UNION ALL
(SELECT 'Append', '1')
(SELECT * FROM [#Result])
--#ImportDataTable