AnsweredAssumed Answered

Import data from PI OLEDB using SQL code instead of "wizard" (i.e. 100 tags in one shot)

Question asked by danielgcalvo on Mar 1, 2016
Latest reply on Mar 2, 2016 by gregor

I´m trying to  automate an importing code that download values from several tags per day.

 

The point is that wizard allow just one Table at once....I want to record one tag in one table , and the same for every tag. i.e. 100tags

 

I guess its would be something like this:

 

OleDbConnection connection = new OleDbConnection .....(CONNECTION TO PIOLEDB)

(IMPORT TO MY DB)

For each tag

......

select tag,time,value,pctgood

From piarchive..piavg

Where tag ='tag1'

AND time BETWEEN '*-1day' AND 't'

AND timestep ='30s'

 

 

Any idea or sample code that could help me?

Thank you in advance!

Outcomes