Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI SQL Client ODBC

Connection string format

  • Last UpdatedSep 27, 2023
  • 2 minute read

ODBC can use a connection string to connect to a database without using a DSN. The connection string for PI SQL Client ODBC includes:

  • The driver name, for example, Driver=PI SQL Client;

  • The AF Server machine name or Location, for example, AF Server=myAfServer; or Location=myAfServer;

  • The AF Database name or Data Source, for example, AF Database=myAFfDatabase; or Data Source=myAfDatabase;

  • Optionally, PI SQL Client ODBC connection string keywords, for example, Integrated Security=SSPI; Command Timeout=60;

The following examples show the syntax for the connection string:

Driver=PI SQL Client; AF Server=myAfServer; AF Database=myAfDatabase; Integrated Security=SSPI;

Driver=PI SQL Client; Location=myAfServer; Data Source=myAfDatabase; Integrated Security=SSPI;

Connection string keywords

The following table lists available keywords for the PI SQL Client ODBC connection string.

Connection string keyword

Description

Examples

Initial Catalog

The initial catalog.

Note: By default, the data model for PI SQL Client consists of one catalog - Master. This catalog contains a set of tables and table-valued functions. For information about how to create other catalogs, see the PI SQL Commander Lite User Guide.

Initial Catalog=Master; (default)

Integrated Security

Name of the authentication service.

Setting the property to SSPI (Security Service Provider Interface) invokes a trusted connection.

Integrated Security=SSPI; (default)

Protocol Order

Order of the protocols used.

Protocol Order=Https/Soap:5464,NetTcp:5465; (default)

Query Date

Defaults to Latest. Also supports now and PI time literals. See the PI Server topic, PI time.

Query Date='now';

Query Date='-1d';

Time Zone

Defaults to Local. You can set a specific time zone used for parsing of timestamp literals and for rendering of timestamp column values.

Time Zone=(UTC-08:00) Pacific Time (US & Canada)

Time Zone=Local

User ID, User, or UID

The User ID to use of authentication when you log on to the data source.

User ID=mydomain\user1;

Password or Pwd

The password to use for authentication when you log on to the data source.

Password=PI;

FileDSN

Specify an ODBC File data source to use for the connection.

FileDSN=MyFile.dsn;

Variant as String

True or False (default). Original Variant columns will be exposed as String columns.

Variant as String=True;

GUID as String

True or False (default). Original GUID columns as String columns.

GUID as String=True;

Maximum string size

Specifies the maximum string size to be returned, because some clients may not handle long string correctly. Use 0 for unlimited size. Defaults to 4000.

Maximum string size=2000;

Command Timeout

Enter the command timeout in seconds. Enforces the command timeout for all commands, even if ODBC statement query timeout was specified.

Command Timeout=20;

TitleResults for “How to create a CRG?”Also Available in