AnsweredAssumed Answered

Error while retrieving data from PI using R

Question asked by ujjwal on Aug 1, 2017
Latest reply on Sep 13, 2017 by ujjwal

I am trying to fetch data from OSI PI through R. I am using PIJDBC driver and RJDBC package.However when I try to get data(more than 10 records) using dbGetquery function I am getting the following error:

Error in .jcall(rp, "I", "fetch", as.integer(n), block) :   java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 10 

 

it is working fine for less than 10 records.Any help pls

 

 

here is my code:

 

library(RJDBC)

drv <- JDBC("com.osisoft.jdbc.Driver",

            "C:/Program Files/PIPC/JDBC/PIJDBCDriver.jar",

            identifier.quote="`")

conn <- dbConnect(drv, "....","........")

dbListTables(conn)

data1 <- dbGetQuery(conn,"SELECT top 10 id FROM pimessagelog")

 

Error in .jcall(rp, "I", "fetch", as.integer(n), block) :   java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 10 

Outcomes