ssavignac

Trying to execute an UPDATE pass-through query on a linked server

Discussion created by ssavignac on Nov 10, 2009
Latest reply on Nov 10, 2009 by spilon

Gurus,

 

I'm trying to execute an update pass-through query on a linked server on MSSQL Server. It goes like this:

 

UPDATE OPENQUERY ( PI, 'SELECT tag, time, _index, value FROM piarchive..picomp2 WHERE tag = ''257_322_CHARBON.pv'' and time = ''11/9/2009 9:00:00 AM''') SET value = 40

 

But I receive this error message:

 

"[OLE/DB provider returned message: Row updating failed. [PI SDK] Server returned write error: : [-15013] PIvalue Type or PIstring is Not Float]

 

OLE DB error trace [OLE/DB Provider 'PIOLEDB' IRowsetChange::SetData returned 0x80004005:   ].

 

Msg 7399, Level 16, State 1, Line 1

 

OLE DB provider 'PIOLEDB' reported an error."

 

The point type is float32. I've tried pushing the values 40.0, ‘40' and ‘40.0' as well with no success.

 

This select query with the same criteria on the same linked server works fine and returns a row:

 

SELECT * FROM OPENQUERY ( PI, 'SELECT tag, time, _index, value FROM piarchive..picomp2 WHERE tag = ''257_322_CHARBON.pv'' and time = ''11/9/2009 9:00:00 AM''')

 

Executing the update query in the PI OLEDB Tester works fine as well. I've also reviewed all the settings for the PIOLEDB provider and the linked server and make sure they're all fine.

 

Any ideas? Thanks

Outcomes