AnsweredAssumed Answered

How to insert Tag Value Using PI OLEDB ?

Question asked by QasimGulzar on Feb 3, 2016
Latest reply on Feb 4, 2016 by QasimGulzar

I am using win32com.client.Dispatch in python to insert Tag value into PI Database.

 

Code :

def insert(self,query):

            if self.isConnected():

                print "We've connected to the database."

                self.oRS = Dispatch('ADODB.RecordSet')

                self.oRS.ActiveConnection = self.connection_string

                # self.oRS.Open("BEGIN TRANSACTION")

                self.oRS.Open(query)

                # self.oRS.Open("COMMIT")

                self.oRS.Close()

                self.oRS = None

            else:

                print "Not connected"

 

function call:

insert("INSERT piarchive..picomp2 (tag, time, value, status) VALUES ('SINUSOIDU', '8/1/2015 12:08:36 AM', -456596, 0)")

 

But I am getting Exception :

 

pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'PIOLEDB', u'Row insertion failed. [PI SDK] Failed to retrieve events from server.  [-10010] PI System Timed Out', None, 0, -2147467259), None)

Outcomes