ImportOleDbQuery Script Examples

From QPR ProcessAnalyzer Wiki
Revision as of 07:06, 7 February 2018 by Ollvihe (talk | contribs)
Jump to navigation Jump to search

This page contains script examples for the ImportOleDbQuery script command.

The following example will load data from an OLE DB source (a sample database called DB1) and selects all columns from the table EXAMPLE. It will then put that data into the "#TABLE" temporary table and then show the contents of that table.

(SELECT 'OleDbConnectionString', 'Provider=SQLOLEDB;Data Source=(local);Initial Catalog=DB1;Integrated Security=SSPI;') UNION ALL
(SELECT 'OleDbQueryString', 'SELECT * FROM EXAMPLE') UNION ALL
(SELECT 'TargetTable', '#TABLE') UNION ALL
(SELECT 'Append', '1')
--#ImportOleDbQuery

(SELECT * FROM #TABLE) UNION ALL
(SELECT 'MaximumCount', '0')
--#ShowReport

The following example will load all the columns from "EXAMPLE" table from an OLE DB source and will put that data into the "ExampleDataTable" in the "ExampleProject" project. It will then get the Data Table analysis from the "ExampleDataTable", put that into the "#TABLE" temporary table and then show the contents of that table.

(SELECT 'ProjectName', 'ExampleProject') UNION ALL 
(SELECT 'DataTableName', 'ExampleDataTable') UNION ALL 
(SELECT 'Append', '0') UNION ALL 
(SELECT 'OleDbConnectionString', 'Provider=SQLOLEDB;Data Source=(local);Initial Catalog=DB1;Integrated Security=SSPI;') UNION ALL 
(SELECT 'OleDbQueryString', 'SELECT * FROM EXAMPLE') 
--#ImportOleDbQuery

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

(SELECT * FROM #TABLE) 
(SELECT 'MaximumCount', '0') 
--#ShowReport