Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI SQL Data Access Server (RTQP Engine)

Element schema

  • Last UpdatedMay 02, 2023
  • 5 minute read

The columns of tables and table-valued functions from the element schema, including name, data type, the information if the field is allowed to have no values, and the primary key, are covered in this topic. The parameters used in table-valued functions are also covered.

Master.Element.Archive

Contains element attribute recorded values.

Name

Data type

Is nullable ?

Primary key

AttributeID

Guid

No

No

TimeStamp

DateTime

No

No

Value

Variant

Yes

No

Value_Int

Int64

Yes

No

Value_Double

Double

Yes

No

Value_String

String

Yes

No

Value_DateTime

DateTime

Yes

No

IsValueAnnotated

Boolean

No

No

IsValueGood

Boolean

No

No

IsValueQuestionable

Boolean

No

No

IsValueSubstituted

Boolean

No

No

Error

String

Yes

No

Master.Element.Attribute

Contains element attributes.

Name

Data type

Is nullable ?

Primary key

ID

Guid

No

Yes

Element

String

No

No

Path

String

No

No

Name

String

No

No

Description

String

Yes

No

ValueType

String

No

No

TraitType

String

No

No

IsConfigurationItem

Boolean

No

No

IsHidden

Boolean

No

No

IsManualDataEntry

Boolean

No

No

DataReference

String

Yes

No

UnitOfMeasure

String

Yes

No

TimeStamp

DateTime

No

No

Value

Variant

Yes

No

Value_Int

Int64

Yes

No

Value_Double

Double

Yes

No

Value_String

String

Yes

No

Value_DateTime

DateTime

Yes

No

IsValueAnnotated

Boolean

No

No

IsValueGood

Boolean

No

No

IsValueQuestionable

Boolean

No

No

IsValueSubstituted

Boolean

No

No

Error

String

Yes

No

UnitOfMeasureID

Guid

Yes

No

TemplateID

Guid

Yes

No

ElementID

Guid

No

No

Master.Element.AttributeCategory

Name

Data type

Is nullable ?

Primary key

AttributeID

Guid

No

Yes

CategoryID

Guid

No

Yes

Attribute

String

No

No

Category

String

No

No

Master.Element.AttributeTemplate

Contains element attribute templates.

In this table, each element template (represented by the column ElementTemplateID) is related with its own attribute templates as well as with all inherited attribute templates from its base templates. That means attribute templates are duplicated for each element template that contains or inherits them. The Boolean column IsInherited can be used to distinguish between these two types of attribute templates.

Notice that the design of the table is different than the table ElementTemplateAttribute in PI OLEDB Enterprise where each element template is related only with its own attributes.

Name

Data type

Is nullable ?

Primary key

ID

Guid

No

Yes

Path

String

No

No

Name

String

No

No

Description

String

Yes

No

ValueType

String

No

No

TraitType

String

No

No

IsConfigurationItem

Boolean

No

No

IsHidden

Boolean

No

No

IsIndexed

Boolean

No

No

IsInherited

Boolean

No

No

IsManualDataEntry

Boolean

No

No

DataReference

String

Yes

No

UnitOfMeasure

String

Yes

No

ElementTemplate

String

No

No

UnitOfMeasureID

Guid

Yes

No

ElementTemplateID

Guid

No

No

Master.Element.AttributeTemplateCategory

Contains attribute categories related with attribute templates. Because an attribute template can be part of multiple element templates (that contain or inherit it, see the AtributeTemplate table), a single association of a category with an attribute template can be represented as multiple relations in this table.

Name

Data type

Is nullable ?

Primary key

TemplateID

Guid

No

Yes

CategoryID

Guid

No

Yes

Template

String

No

No

Category

String

No

No

Master.Element.Element

Contains elements.

Name

Data type

Is nullable ?

Primary key

ID

Guid

No

Yes

Name

String

No

No

Description

String

Yes

No

Comment

String

Yes

No

Revision

Int32

No

No

HasChildren

Boolean

No

No

PrimaryPath

String

No

No

Template

String

Yes

No

Created

DateTime

No

No

CreatedBy

String

No

No

Modified

DateTime

No

No

ModifiedBy

String

No

No

TemplateID

Guid

Yes

No

Master.Element.ElementCategory

Name

Data type

Is nullable ?

Primary key

ElementID

Guid

No

Yes

CategoryID

Guid

No

Yes

Element

String

No

No

Category

String

No

No

Master.Element.ElementHierarchy

Contains element hierarchy.

Name

Data type

Is nullable ?

Primary key

Path

String

No

Yes

Name

String

No

Yes

Level

UInt8

No

No

IsPrimaryPath

Boolean

No

No

ElementID

Guid

No

No

ParentElementID

Guid

Yes

No

Master.Element.ElementTemplate

Contains element templates.

Name

Data type

Is nullable ?

Primary key

ID

Guid

No

Yes

InheritancePath

String

No

No

Name

String

No

No

Level

UInt8

No

No

Description

String

Yes

No

BaseID

Guid

Yes

No

Master.Element.ElementTemplateCategory

Name

Data type

Is nullable ?

Primary key

TemplateID

Guid

No

Yes

CategoryID

Guid

No

Yes

Template

String

No

No

Category

String

No

No

Master.Element.FindElements()

Returns a list of elements which matches the query criteria passed to the function parameter.

For more information, see the AF SDK Reference page AFElement.FindElements Method.

Parameters

Name

Data type

Query

String

Columns

Name

Data type

Is nullable ?

Primary key

ID

Guid

No

Yes

Name

String

No

No

Description

String

Yes

No

Comment

String

Yes

No

Revision

Int32

No

No

HasChildren

Boolean

No

No

PrimaryPath

String

No

No

Template

String

Yes

No

Created

DateTime

No

No

CreatedBy

String

No

No

Modified

DateTime

No

No

ModifiedBy

String

No

No

TemplateID

Guid

Yes

No

Example:

SELECT Name FROM Master.Element.FindElements(
N'Template:Heater Category:"Equipment Assets"')

Master.Element.GetPlotValues()

Retrieves values over the specified time range suitable for plotting over the number of intervals.

For more information, see the AF SDK Reference page AFData.PlotValues Method.

Parameters

Name

Data type

AttributeID

Guid

StartTime

DateTime

EndTime

DateTime

IntervalCount

Int32

Columns

Name

Data type

Is nullable ?

Primary key

TimeStamp

DateTime

No

No

Value

Variant

Yes

No

Value_Int

Int64

Yes

No

Value_Double

Double

Yes

No

Value_String

String

Yes

No

Value_DateTime

DateTime

Yes

No

IsValueAnnotated

Boolean

No

No

IsValueGood

Boolean

No

No

IsValueQuestionable

Boolean

No

No

IsValueSubstituted

Boolean

No

No

Error

String

Yes

No

Master.Element.GetSampledValue()

Returns a sampled value at the specified time.

Parameters

Name

Data type

AttributeID

Guid

Time

DateTime

Columns

Name

Data type

Is nullable ?

Primary key

Value

Variant

Yes

No

Value_Int

Int64

Yes

No

Value_Double

Double

Yes

No

Value_String

String

Yes

No

Value_DateTime

DateTime

Yes

No

IsValueAnnotated

Boolean

No

No

IsValueGood

Boolean

No

No

IsValueQuestionable

Boolean

No

No

IsValueSubstituted

Boolean

No

No

Error

String

Yes

No

Master.Element.GetSampledValues()

Returns several sampled values within the specified time range.

Parameters

Name

Data type

AttributeID

Guid

StartTime

DateTime

EndTime

DateTime

TimeStep

TimePeriod

Columns

Name

Data type

Is nullable ?

Primary key

TimeStamp

DateTime

No

No

Value

Variant

Yes

No

Value_Int

Int64

Yes

No

Value_Double

Double

Yes

No

Value_String

String

Yes

No

Value_DateTime

DateTime

Yes

No

IsValueAnnotated

Boolean

No

No

IsValueGood

Boolean

No

No

IsValueQuestionable

Boolean

No

No

IsValueSubstituted

Boolean

No

No

Error

String

Yes

No

Master.Element.GetSummaries()

Returns several summaries for a single attribute over a time range for each interval within the range.

For more information, see the AF SDK Reference page AFData.Summaries Method.

Parameters

Name

Data type

AttributeID

Guid

StartTime

DateTime

EndTime

DateTime

TimeStep

TimePeriod

SummaryType

String

CalculationBasis

String

TimeType

String

For allowed values of the particular [TVF].Element.GetSummaries arguments, see the following AF SDK Reference pages:

  • SummaryType: AFSummaryTypes Enumeration

  • CalculationBasis: AFCalculationBasis Enumeration

  • TimeType: AFTimestampCalculation Enumeration

    Columns

    Name

    Data type

    Is nullable ?

    Primary key

    TimeStamp

    DateTime

    No

    No

    Value

    Variant

    Yes

    No

    Value_Int

    Int64

    Yes

    No

    Value_Double

    Double

    Yes

    No

    Value_String

    String

    Yes

    No

    Value_DateTime

    DateTime

    Yes

    No

    IsValueAnnotated

    Boolean

    No

    No

    IsValueGood

    Boolean

    No

    No

    IsValueQuestionable

    Boolean

    No

    No

    IsValueSubstituted

    Boolean

    No

    No

    Error

    String

    Yes

    No

Master.Element.GetSummary()

Returns several summaries for a single attribute over a single time range.

For more information, see the AF SDK Reference page AFData.Summary Method.

Parameters

Name

Data type

AttributeID

Guid

StartTime

DateTime

EndTime

DateTime

SummaryType

String

CalculationBasis

String

TimeType

String

For allowed values of the particular [TVF].Element.GetSummary arguments, see the following AF SDK Reference pages:

  • SummaryType: AFSummaryTypes Enumeration

  • CalculationBasis: AFCalculationBasis Enumeration

  • TimeType: AFTimestampCalculation Enumeration

    Columns

    Name

    Data type

    Is nullable ?

    Primary key

    TimeStamp

    DateTime

    No

    No

    Value

    Variant

    Yes

    No

    Value_Int

    Int64

    Yes

    No

    Value_Double

    Double

    Yes

    No

    Value_String

    String

    Yes

    No

    Value_DateTime

    DateTime

    Yes

    No

    IsValueAnnotated

    Boolean

    No

    No

    IsValueGood

    Boolean

    No

    No

    IsValueQuestionable

    Boolean

    No

    No

    IsValueSubstituted

    Boolean

    No

    No

    Error

    String

    Yes

    No

TitleResults for “How to create a CRG?”Also Available in