I am trying to execute the following query to retrieve snapshot values of element attributes which have PI Point data references:
SELECT eh.Path + eh.Name + ea.Path + ea.Name Path, r.Time, r.Value FROM AFDB.Asset.ElementHierarchy eh INNER JOIN AFDB.Asset.ElementAttribute ea ON ea.ElementID = eh.ElementID INNER JOIN AFDB.Data.Snapshot r ON r.ElementAttributeID = ea.ID WHERE eh.Path LIKE '\EHPath%' AND eh.Name = 'EHName' AND ea.Name = 'EAName'
However the config string is set at the template level and some template instances do not have a corresponding PI Point. I would expect to get null snapshot values for the element attributes that do not map to a PI Point, but instead I get the following error:
[OSIsoft.AF.Asset.DataReference.PIPoint] Cannot retrieve PI Point <PI Point> for attribute <Attribute>
Is this the expected behavior of OLEDB Enterprise ? If so, is there an alternate query that would not throw an error ? I tried a left outer join for the Snapshot table but with no luck.