Erik.Haug

PIOLEDB 4.0 beta - How to select by Guid

Discussion created by Erik.Haug on Dec 16, 2009
Latest reply on Dec 17, 2009 by michaelh

I'm currently trying to figure out how to select the attributes for a AF Element specified by its guid. I have tried the following:

SELECT ea.Name

FROM ElementHierarchy eh

INNER JOIN ElementVersion ev ON ev.ID = eh.ElementVersionID

INNER JOIN ElementAttribute ea ON ea.ElementVersionID = ev.ID

WHERE

eh.ElementID = '2dfa6780-a57f-4443-a3a0-150f74b20be9'

This results in the following error in PI System SQL Commander:

 

"Overload resolution failed for (=) argument(s). "

 

I have also tried to cast the guid:

 


eh.ElementID = cast('2dfa6780-a57f-4443-a3a0-150f74b20be9' as Guid)

 

I get the following error:

 

eh.ElementID = cast('2dfa6780-a57f-4443-a3a0-150f74b20be9' as Guid)

 

How can I overcome these problems?

Outcomes