VCampus-METCO

PI-OLEDB Enterprise and WebParts DataSets

Discussion created by VCampus-METCO on Feb 3, 2011
Latest reply on Feb 3, 2011 by Ahmad Fattahi

Is there a known problem in using OLEDBEnt datasets with placeholders with WebParts 2010?

 

I have a query that works fine when the element name is hard-coded (B1), but returns nothing when a placeholder is used to pass the same element name.

 

And having the time context as placeholders also appears not to work because when the SQL is validated, OLEDBEnt treats the ? as a time specification, rather than subsituting the time that you want! So it generates an SDK Time format error.

 

I am using PI Data Services to setup the query, but ultimately will connect a treeview webpart to a table webpart.. Sample SQL code is below.

 
SELECT sum(cast (a.Value as single)) Total
FROM OilandGas.Asset.ElementHierarchy eh
INNER JOIN OilandGas.Asset.ElementAttribute ea ON ea.ElementID = eh.ElementID
INNER JOIN OilandGas.Data.Archive a ON a.ElementAttributeID = ea.ID
WHERE eh.name = N'?' and ea.name = 'GasProduction' AND a.Time BETWEEN N't-30d' AND N't'
OPTION (FORCE ORDER)

 

Outcomes