Retrieve interpolated values using Simplified Asset Database E-R Model (2)
- Last UpdatedSep 29, 2022
- 1 minute read
- PI System
- PI OLEDB Enterprise 2019
- Developer
The following query is equivalent to the previous one. Each built-in TVF (like InterpolateRange) has a function table counterpart. Function tables offer alternative syntax for calling TVFs. They are intended to be used from third party clients that do not allow executing queries containing TVFs directly (for example, SQL Server). Function arguments are represented by columns which must be restricted in the clause.
SELECT eh.Path + eh.Name + ea.Path + ea.Name ElementAttribute, i.*
FROM NuGreen.Asset.ElementHierarchy eh
INNER JOIN NuGreen.Asset.ElementAttribute ea ON ea.ElementID = eh.ElementID
INNER JOIN NuGreen.Data.ft_InterpolateRange i ON i.ElementAttributeID = ea.ID
WHERE eh.Path LIKE N'\NuGreen\Little Rock\Extruding Process\%'
AND eh.Name LIKE N'B-%'
AND ea.Name LIKE N'%Flow'
AND i.StartTime = DATE('*') - TIME('1h')
AND i.EndTime = DATE('*')
AND i.TimeStep = TIME('10m')
OPTION (FORCE ORDER)