Assumptions about timestamps and data sets, Stored procedures in queries – Rockwell Automation FactoryTalk Historian SE ProcessBook 3.2 User Guide User Manual

Page 294

Advertising
background image

FactoryTalk Historian ProcessBook User Guide

276

Assumptions About Timestamps and Data Sets

When a trend receives data from an ODBC data source, it receives the data
as a Time / Value pair. The Value is generated by the query. The Time,
however, may be obtained in one of two ways:

If a Tag placeholder is used, then the time will be the time returned by
the Tag. This time will supersede any timestamps returned by the
query.

One or more of the columns returned by the query may contain a date
and/or time. If more than one timestamp column is returned, the first
one as ordered by the SQL query is used.

Stored Procedures in Queries

Stored procedures can be used in ODBC data sets. They may contain
placeholders as long as your database accepts the stored procedures call as
a text string. The common syntax for this is:

execute procname ('arg', 22, ?)

Check the documentation of your database management system for details.

Stored procedures generally return results in rows and columns, just as a
normal SQL query does.

The only way to determine the columns returned by a stored procedure is
to perform a test execution. When you are building the data set, because
ProcessBook needs to know the columns returned, it executes the
procedure. If the procedure call includes placeholders, the following
defaults are used:

Text

Actual text placeholder string

StartTime

Current time

EndTime

Current time

Tag

0

Advertising