Advanced PI SQL Client ODBC topics
- Last UpdatedSep 29, 2022
- 1 minute read
- PI System
- PI SQL Client ODBC 2021
- Developer
Multithreading
PI SQL Client ODBC supports query execution from multiple threads. OSIsoft recommends you reuse connection objects as often as possible because connection open and close operations are expensive. For example, connection objects can be passed as parameter to a new thread and when that thread is finished, it returns that connection to a connection pool.
Multiple connections
Multiple connections from one PI SQL Client ODBC application to different PI SQL Data Access Server (RTQP Engine) (installed on multiple nodes) are supported.
ODBC driver and variant data types
PI SQL Client ODBC supports columns that have DBTYPE_VARIANT as the underlying OLE DB data type. PI SQL Client ODBC uses the same approach as is used for Microsoft ODBC drivers and the underlying SQL Server data type sql_variant.
Applications developed in .NET, using namespace System.Data.ODBC automatically recognize such a column as Object. To recognize the contained subtype, you can use the GetType method describe in the Microsoft article GetType method.
For native code applications, see the Microsoft article Mapping Data Types (ODBC).
Applications that use binding usually bind the column to a string data type.