AnsweredAssumed Answered

PI SQL Commander - Event frame query

Question asked by JavithFareeth on May 17, 2018
Latest reply on Jun 10, 2018 by vkaufmann

I wanted to create reports in MS reports and I am trying to build event frame PI SQL query (Mentioned below). But it take more than 4 to 5 mins to execute and gets timeout.

System explorer and PI datalink pulls out the same result in few seconds. I am trying to get the same content (Event start time , Primary Element Name , event frame attributes)

 

My query from transpose function:

 

Create VIEW [RN_AF].[DataT].[vAuto]

(

[EventFrame],

[ANumber],

[CrustBr],

[M1L],

[M1R],

[M2L],

[M2R],

[M3L],

[M3R],

[M4L],

[M4R],

[M5L],

[M5R],

 

[StartTime]

)

AS

SELECT ef.Name EventFrame, ts.*

FROM

(

 

SELECT  *

FROM [RN_AF].[EventFrame].[EventFrame]

WHERE EventFrameTemplateID IN

(

SELECT ID

FROM [RN_AF].[EventFrame].[EventFrameTemplate]

WHERE Name = N'Gauging'

)order by StartTime Desc 

) ef

INNER JOIN [RN_AF].[EventFrame].[EventFrameHierarchy] efh

ON efh.ID = ef.ID

CROSS APPLY [RN_AF].[DataT].[FTGauging]

(

ef.ID

) ts

OPTION (FORCE ORDER, IGNORE ERRORS, EMBED ERRORS)

Outcomes