AnsweredAssumed Answered

PI ODBC - SQL Select on picomp

Question asked by rita_tavares on May 26, 2015
Latest reply on May 29, 2015 by Asle Frantzen
Branched to a new discussion

PI ODBC select on picomp, returns values in status field, and NULL in value field, but only for manual tags:

 

 

the code:

"

DECLARE @Tags VARCHAR(8000), @TSQL varchar(8000)

 

 

SELECT @Tags = COALESCE(@Tags + ''''', ''''', '''') + pI_TAG

FROM Q5admin.MAEG_PI_CONT

 

SELECT  @TSQL = 'SELECT
*  FROM OPENQUERY(piserver,''SELECT tag, Value, Status FROM picomp WHERE
tag in ('''
+ @Tags + ''''') AND Time =
DATE(''''*'''')'')'
                           

EXEC (@TSQL)

"

the result:

PIOdbcSelect.jpg

 

any ideas?

thanks for your time.

Outcomes