AnsweredAssumed Answered

Cannot Use String Literals in EXECUTE Query on PI OLE DB version 3.4.1.28

Question asked by justin.mcdaniel on Dec 28, 2017
Latest reply on Dec 29, 2017 by ray

This works in PI OLE DB version 3.3.1.2. After upgrading to PI OLE DB version 3.4.1.28, I am unable to execute the following query when accessing the PI linked server from SQL Server 2012 SP3:

 

DECLARE @piTag nvarchar(250) = 'sinusoid'
EXECUTE(N'
    SELECT (?) as tag'
    , @piTag
) AT PISERVER

 

This query is a "watered down" version of what I'm trying to do. I tested with a DATETIME2 parameter and that worked, but varchar/nvarchar parameters do not. I was able to narrow the error to this as the cause. I just receive the following error now:

 

 

This is the result on PI OLE DB version 3.3.1.2:

 

Is this a known issue or is there a workaround?

 

Thanks,

Justin

Outcomes