AnsweredAssumed Answered

Facing problem in querying mysql data to Pi

Question asked by usman7 on Sep 24, 2017

Hi,

I have some data recorded in Mysql database now I want to link this data to PI. I am new to this topic and dont have much information about it.

 

 

 

I have used Pi interface for RDBMS VIA ODBC TO link Mysql. The Mysql driver I have used is Mysql odbc 5.3 unicode Driver. I have successfully created the interface.

Now just in order to test the connection I have created a pi tag. For testing purpose, I will pull only one data from the table which is the value of Va.

In PI SMT using Point builder I have created the tag and following is the SQL statement I have used

 

/SQL="SELECT 'timestamp' AS PI_TIMESTAMP, 'Va', 0 FROM '101test' WHERE time >? ORDER BY timestamp ASC;" P1=TS

 

Following are the archive and classic settings

After saving this when I go to current values under data, it shows me that Pt Created but doesn’t show me the value which is in MySql table.

 

Can you please tell me what am I doing wrong? Is my Sql statement incorrect in point builder or something wrong with the Classic settings

 

Thank you.

In PI SMT using Point builder i have created the tag and following is the sql statement I have used

 

/SQL="SELECT 'timestamp' AS PI_TIMESTAMP, 'Va', 0 FROM '101test' WHERE time >? ORDER BY timestamp ASC;" P1=TS

 

Following are the archive and classic settings

Outcomes