How to use IP21 stored procedures
This article explains how you can use stored procedures (SP) to pull in time series data from your IP21 historian.
Open Aspen SQLPlus tool. Write the stored procedure, like:
PROCEDURE sp_getValuesTrendminer(tagName record, startTime timestamp, endTime timestamp, interpolationType CHARACTER, period INTEGER) SELECT IP_TREND_TIME, IP_TREND_VALUE FROM IP_AnalogDef WHERE name = tagName AND IP_TREND_TIME BETWEEN startTime AND endTime ORDER BY IP_TREND_TIME ASC; END
Go to “Record->Save as” and save the SP with a given name.

The SP definition can be viewed from Aspen SQLPlus tool, Record->Open menu.
Configure the connector (Plant Integrations) to use Stored procedures as explained in this article: IP21 stored procedures
When the connector config is updated the connector will use the "sp_getValuesTrendminer" Stored Procedure to get time-series data from IP21.
Notice
This stored procedure is only used for retrieving timeseries data. Other queries such as retrieval of the tag list use the standard IP21 provider query.