Issue
Import data from the SQL database of a facility management system into the I/A Series R2 system.
Environment
I/A Series R2 system
External SQL database
Cause
Import data from the SQL database of a facility management system into the I/A Series R2 system.
Resolution
This module sqlUtility contains an object called "SqlData" that can be used to perform a SQL query on any SQL database.
The sqlUtility can be used only in an Enterprise Server, not in a UNC.
Using this object, you need to create a SQL query to return a single column in the data table.
Here is a sample query that returns the column EnergyIntensity from the EnergyTable.
SELECT EnergyIntensity FROM EnergyTable ORDER BY O_Id DESC
This query returns the EnergyIntensity column of the table "EnergyTable" after sorting the record number (O_Id) in descending order. The data value returned by the SqlData query will be the first element in the first column of the query results. Since the query uses the ORDER BY data qualifier, specifying descending order of the record numbers (O_Id), the newest value will be returned.