Table and table-valued function template structures
- Last UpdatedDec 19, 2022
- 1 minute read
Table templates and table-valued function templates do not have any structure themselves. You can use them to create a table or table-valued function with a specific structure by providing template arguments. The new created table or table-valued function can be referenced in a query.
All the templates in RTQP are based on AF element templates or AF event frame templates. The first template parameter is always the name of the AF element or event frame template on which it is based. The subsequent template parameters specify which attribute templates should be included in the result as columns. Each attribute template parameter is a collection of sub-parameters which identify the AF attribute template and what type of data should be returned as columns.
Table and table-valued function templates are listed by their names in the topics in this section.
Examples
The following table template specialization is a table consisting of six columns, five of which are defined in the template arguments: [ElementID] (implicitly provided), [Fuel Gas Flow TimeStamp], [Fuel Gas Flow], [Water Flow TimeStamp], [Water Flow], and [Water Flow UOM].
[Master].[Element].[Value]
<
N'Boiler', -- Template name
{ -- The first attribute template sub-parameter collection
N'|Fuel Gas Flow', -- Attribute template path
N'Fuel Gas Flow TimeStamp', -- Timestamp column name
N'Fuel Gas Flow' -- Value column name
},
{ -- The second attribute template sub-parameter collection
N'|Water Flow',
N'Water Flow TimeStamp',
N'Water Flow' ,
N'Water Flow UOM' -- Unit of measure column name
}
>