How to get Event Frame Attribute value using OLEDB Enterprise

Hello,

I am trying to retrieve few event frames and query is as below:

------------------------------------------------------------------

SELECT ef.Name, ef.StartTime, ef.EndTime,efa.Name [Alert Level]

FROM AFDatabase.EventFrame.EventFrameTemplate eft

INNER JOIN AFDatabase.EventFrame.EventFrame ef ON ef.EventFrameTemplateID = eft.ID

INNER JOIN AFDatabase.EventFrame.EventFrameAttribute efa ON efa.EventFrameID = ef.ID

WHERE eft.Name = N'EventFrameTemplate'

AND ef.StartTime BETWEEN '01-Jul-2023' AND '31-Jul-2023'

AND efa.Name = N'EventFrameAttribute'

AND ef.Name in 

(

'Event1name',

'Event2name',

'Event3name',

'Event4name',

'Event5name',

)

OPTION (FORCE ORDER)

------------------------------------------------------------------

 

When I run the query the Attribute column [Alert Level] shows attribute name Alert Level instead of value.
image.png
Please suggest, what is missing here!

 

Thanks

Parents
  • Hello ​ ,

    The Query Compendium is included with PI OLEDB Enterprise. You can open it e.g. by clicking the [Query Compendium] button in PI SQL Commander Lite. For the type of query, I suggest you to look at Event Frame Data queries (PI OLEDB Enterprise -> Queries -> Event Frames -> 2-EventFrameData.sql). If you don't like to use PI SQL Commander Lite, you can also open the sample query files from disk e.g. %pihome%\SQL\SQL Commander\PI SQL Query Compendium\PI OLEDB Enterprise\Queries\Event Frames\2-EventFrameData.sql

Reply
  • Hello ​ ,

    The Query Compendium is included with PI OLEDB Enterprise. You can open it e.g. by clicking the [Query Compendium] button in PI SQL Commander Lite. For the type of query, I suggest you to look at Event Frame Data queries (PI OLEDB Enterprise -> Queries -> Event Frames -> 2-EventFrameData.sql). If you don't like to use PI SQL Commander Lite, you can also open the sample query files from disk e.g. %pihome%\SQL\SQL Commander\PI SQL Query Compendium\PI OLEDB Enterprise\Queries\Event Frames\2-EventFrameData.sql

Children
No Data