[R] Run time error when executing sqlQuery using the 64-bit version of R with 64-bit RODBC package in a Solaris 10 Sparc machine.

Eric Ma eric.ma at db.com
Thu Jan 21 00:08:36 CET 2010


Wow, this is as much hand-holding as one can expect, and for a R newbie it is
unbelievable and invaluable!  Thanks again for all this help Marc!

Here is the screen print of my entire R session:

> .Machine$sizeof.pointer
[1] 8
> 
> library(RODBC)
> conn <- odbcConnect(dsn='qdblocal', uid = "ciqxf", pwd = "ciqxf")
> data <- sqlQuery(conn, "select sysdate from dual", rows_at_time = 1)
Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max, buffsize, 
: 
  negative length vectors are not allowed
> debug(odbcFetchRows)
> data <- sqlQuery(conn, "select sysdate from dual", rows_at_time = 1)
debugging in: odbcFetchRows(channel, max = max, buffsize = buffsize,
nullstring = nullstring, 
    believeNRows = believeNRows)
debug: {
    if (!odbcValidChannel(channel)) 
        stop("first argument is not an open RODBC channel")
    .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max, 
        buffsize, as.character(nullstring), believeNRows)
}
Browse[2]> ls()
[1] "believeNRows" "buffsize"     "channel"      "max"          "nullstring"  
Browse[2]> believeNRows
[1] TRUE
Browse[2]> buffsize
[1] 1000
Browse[2]> channel
RODBC Connection 1
Details:
  case=nochange
  DSN=qdblocal
  UID=ciqxf
  PWD=******
  DBQ=QDBLOCAL
  DBA=W
  APA=T
  EXC=T
  FEN=T
  QTO=T
  FRC=10
  FDL=10
  LOB=T
  RST=T
  BTD=F
  BNF=F
  BAM=IfAllSuccessful
  NUM=NLS
  DPM=F
  MTS=T
  MDI=F
  CSR=F
  FWC=F
  FBS=64000
  TLO=0
  MLD=0
  ODA=F
Browse[2]> max
[1] 0
Browse[2]> nullstring
[1] NA
Browse[2]> Q
>

I hope it offers more info.  Looking at the code of RODBC.c, could the
folliwng in the RODBCFetchRows method throw an error if for some reason the
value of stat is <0?

SET_VECTOR_ELT(ans, 1, ScalarInteger(stat));

Eric
-- 
View this message in context: http://n4.nabble.com/Run-time-error-when-executing-sqlQuery-using-the-64-bit-version-of-R-with-64-bit-RODBC-package-in-a--tp975458p1020700.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list