Error trying to acess PI Server through PI OLEDB (.NET)

Discussion created by henrique.bueno on Jan 29, 2013
Latest reply on Feb 5, 2013 by henrique.bueno

Pi server returns a unknown error with error code -2147467259 when executing a query listed in bold below. Here is the content of the log file:


28-Jan-2013 15:58:49.587 PROVIDER_INIT iisipmee0c0517-a1b7-47b0-ab24-6bbed72e68de -t 20 -ap ".Net 3 4948 20 2212 Data Source IDBInitialize Initialize User ID = bioep_gedig; Init Catalog = piarchive; Data Source = SBCPI01; Connection Timeout = 100000; Command Timeout = 100000000; Log Level = 0; Log File = C:\Program Files\PIPC\OLEDB\Log\PIOLEDB-TESTE-v3-2013-01-28.log; Shorten Primary Keys = False; Always Return Rowset = False; Defer Execution = False; Identifier Prefixes = False; Disable Server Selection = False; Time as Double = False; Optimization Log Limit = 100; Session ID = -1; Session Pipelines = 1; Integrated Security = ; Keep Default Ordering = True; Cancel On Low Resources = True; Evaluation Errors As Warnings = True; Default Timestep = 1h; Integers as Value = True; Timestamp Interval Start = False; Support PI Wildcards = True; Time Zone = Local; Current Time Precision = 0; Show Hidden Metadata = False; Integrated Security = ;Connection Type = PreferPrimary 28-Jan-2013 15:58:49.587 PROVIDER_INIT iisipmee0c0517-a1b7-47b0-ab24-6bbed72e68de -t 20 -ap ".Net 3 4948 20 2212 Data Source IDBInitialize Initialize OLE DB Provider Version =; Server Version = 3.4.371.1; PI SDK Version =; 28-Jan-2013 15:58:49.587 SQL_ENGINE_INFO_1 iisipmee0c0517-a1b7-47b0-ab24-6bbed72e68de -t 20 -ap ".Net 3 4948 20 2212 SQL Engine Command to prepare: SELECT PC.TAG, PC.TIME, CASE WHEN PP.POINTTYPEX = 'digital' THEN CAST(DIGSTRING(PC.STATUS) AS STRING) WHEN PP.POINTTYPEX = 'string' OR PP.POINTTYPEX = 'blob' THEN CAST(SVALUE AS STRING) ELSE CAST(VALUE AS STRING) END AS value, PP.ENGUNITS FROM PICOMP PC, () )PP WHERE PC.TAG in () AND PP.TAG = PC.TAG AND PC.TIME = '*' AND DIGSTRING(PC.STATUS) NOT IN ('Arc Off-line','Bad','Bad Input','Bad InputBad Input','Bad InputBad InputBad Input','Bad InputI/O Timeout','Bad InputI/O TimeoutI/O Timeout','BadBad','BadBadBad','Calc Failed','Comm Fail','Comm FailComm Fail','Comm FailComm FailComm Fail','Configure','Doubtful','Error','ErrorError','ErrorErrorError','Failed','FailedFailed','FailedFailedFailed','Intf Shut','Intf ShutIntf Shut','Intf ShutIntf ShutIntf Shut','I&O Timeout','I/O Timeout','I/O TimeoutBad Input','I&O Timeout&I&O Timeout','I&O TimeoutI&O Timeout','I/O TimeoutI/O Timeout','I&O Timeout&I&O Timeout&I&O Timeout','I&O TimeoutI&O TimeoutI&O Timeout','I/O TimeoutI/O TimeoutI/O Timeout','No Data','No DataNo Data','No DataNo DataNo Data','Not Connect','Not ConnectNot Connect','Not ConnectNot ConnectNot Connect','NULL','NULLNULL','NULLNULLNULL','Out of Serv','Out of ServOut of Serv','Out of ServOut of ServOut of Serv','Pt Created','Pt Created','Pt CreatedPt Created','Pt CreatedPt CreatedPt Created','Scan Off','Scan OffScan Off','Scan OffScan OffScan Off','Scan Timeout','Scanning RTU','Shutdown','ShutdownShutdown','&Shutdown&Shutdown&Shutdown','Shutdown&Shutdown&Shutdown','ShutdownShutdownShutdown','?0','0[não definido]','3[não definido]') ORDER BY PC.TAG, PC.TIME DESC 28-Jan-2013 15:58:53.743 ERROR_RECORD iisipmee0c0517-a1b7-47b0-ab24-6bbed72e68de -t 20 -ap ".Net 3 4948 20 2212 Command ICommand Execute E_FAIL - Unknown error.


This query is executed  through a OLEDB command issued by  a .NET application. Here is the stack trace:


System.Data.OleDb.OleDbException was caught Message=Unknown error. Source=PIOLEDB ErrorCode=-2147467259 StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at br.com.petrobras.operational.controls.PIServer.ExecuteReader(DbCommand cmd) in C:\Work\workspaces\microsoft\OperationalData\OperationalDataServiceLibrary\controls\PIServer.cs:line 577 InnerException:


If we get this same query and execute it with the tool (PI OLE DB Tester) running in another machine, the query returns without any error.


Any clue or thoughts that could help us?


 Hi Mathieu,


Delete part of the query by private information ashoe.