VTScada SQLInterface Module

This service provides an SQL interface to VTScada historical data, current tag values, alarm data, or other custom tables on an application-by-application basis.

The interface can be accessed externally using SOAP or ODBC calls, providing support for a subset of SQLClosed Structured Query Language. Within VTScada, you might use the SQLInterface for the convenience that the SQLQuery function provides in some instances, relative to making multiple calls to GetTagHistory.

The SQLQuery function is essentially a wrapper for GetTagHistory. No SQL query parameters are supported other than those that can be performed by one or more calls to GetTagHistory and other VTScada functions. SQL functions that modify data or database structures are not supported.

The interface provides the following two functions:

  • SQLQuery
    Executes an SQL query on data in a VTScada application by turning that query into one or more calls to GetTagHistory.
  • RegisterCustomTable
    Before SQLQuery can be work, RegisterCustomTable must be used to record what information is to be available for a defined table name and how values are to be retrieved. All VTScada tags, notes, and alarm information has already been registered for you. Use this function only for custom data inquiry needs.

SQL queries specify table names where data is to be found. This does not match the system used by VTScada for data storage or retrieval, even if you have configured your Historian to use a third-party SQL database. There is no History table, nor is there an Alarms table, nor any History:TPP tables. But, the SQLQuery function is able to retrieve tag data as if those tables existed because RegisterCustomTable was use to link table names to the instructions for finding relevant data.