ImportOdbcQuery Script Examples: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
</pre>
</pre>


The following is the same command as the previous, except instead of a plaintext connections string (which might contain passwords), the connections string is stored as a [[Secure Strings|secure string]] with name ''MySecureConnectionString'':
<pre>
(SELECT 'OdbcConnectionStringKey', 'MySecureConnectionString') UNION ALL
(SELECT 'OdbcQueryString', 'SELECT * FROM PA_MODEL') UNION ALL
(SELECT 'TargetTable', '#ImportOdbcTable') UNION ALL
(SELECT 'Append', '1')
--#ImportOdbcQuery
</pre>


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

Revision as of 18:20, 15 March 2020

This page contains script examples for the ImportOdbcQuery script command.

The following script extracts data from an ODBC connection to QPR ProcessAnalyzer database and selects all columns from the table PA_MODEL.

(SELECT 'OdbcConnectionString', 'DSN=PA_EXPRESS_40') UNION ALL
(SELECT 'OdbcQueryString', 'SELECT * FROM PA_MODEL') UNION ALL
(SELECT 'TargetTable', '#ImportOdbcTable') UNION ALL
(SELECT 'Append', '1')
--#ImportOdbcQuery

The following is the same command as the previous, except instead of a plaintext connections string (which might contain passwords), the connections string is stored as a secure string with name MySecureConnectionString:

(SELECT 'OdbcConnectionStringKey', 'MySecureConnectionString') UNION ALL
(SELECT 'OdbcQueryString', 'SELECT * FROM PA_MODEL') UNION ALL
(SELECT 'TargetTable', '#ImportOdbcTable') UNION ALL
(SELECT 'Append', '1')
--#ImportOdbcQuery