Query parameters
- Last UpdatedOct 21, 2026
- 2 minute read
- PI System
- Adapter for RDBMS 1.1
- Adapters
The following parameters are available to configure queries to be sent to the Open Database Connectivity (ODBC) driver. The supported query syntax depends on the ODBC driver you are using. These queries are sent to the driver exactly as defined, and the adapter uses the driver response to collect data.
Refer to the documentation for your ODBC driver for supported query syntax.
|
Parameter |
Required |
Type |
Description |
|---|---|---|---|
|
queryString |
Required |
string |
The SQL query to run. |
|
id |
Required |
string |
String identifier of the query to be referenced by data selection items. |
Within queryString, you can use the placeholder values listed below to streamline query configuration. Delimit the placeholders with question marks.
Note: For placeholder resolution, history recovery includes both on-demand history recovery and automatic backfill recovery. Both operations use the history query path and use the following history recovery values.
|
Placeholder |
Description |
History recovery value |
Normal operation value |
|---|---|---|---|
|
?LST? |
?LST?, Last Scan Time, represents the last successful scan time (checkpoint) |
Earliest last scan time across the selected items for the query. |
Earliest last scan time across the selected items for the query. |
|
?ST? |
?ST?, Start Time, represents the start of the query window and currently resolves to the same value as ?LST?. |
Earliest last scan time across the selected items for the query. |
Earliest last scan time across the selected items for the query. |
|
?ET? |
?ET?, End Time, represents the end of the query window. |
?ST? + RequestInterval, capped at the configured recovery end time |
Current adapter time (UTC when UTC=true; local adapter time when UTC=false) |
Note: ?LST? and ?ST? currently resolve to the same timestamp but represent different concepts. ?LST? represents the last successful scan time (checkpoint), while ?ST? represents the start of the query time window. Maintaining separate placeholders improves query readability and allows future implementations to use different values, if necessary.
Timestamp format
Placeholder values are inserted into the SQL query as ODBC timestamp literals using the following format, yyyy-MM-dd HH:mm:ss.fff.
Timestamp values have millisecond precision. Time zone handling is controlled by the UTC setting:
-
UTC=true uses UTC-based timestamps.
-
UTC=false uses the adapter's local time.
SQL data type considerations
Placeholder values are substituted into the SQL text as timestamp literals and are not passed as typed database date/time parameters. The database engine performs any necessary type conversion.
If your database requires a specific date/time type or format, explicitly convert the placeholder value within the query. For example, in Microsoft SQL Server, you may need to use CAST or CONVERT to ensure the placeholder value is treated as the intended datetime or datetime2 type.