Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 992777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:19:12+00:00 2026-05-16T06:19:12+00:00

RODBC error in Revolution R 64bit on winxp64 bit connected to Oracle using a

  • 0

RODBC error in Revolution R 64bit on winxp64 bit connected to Oracle using a 64bit ODBC driver thru a DSN

library(RODBC)
db <- odbcConnect("oraclemiso",uid="epicedf",pwd="…")
rslts = sqlQuery(db, "select count(*) from FTRAuction")

Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max, buffsize,  : 
  negative length vectors are not allowed

I am able to connect but get an error when I query for stuff,
also the below works

 library(RODBC)
 channel <- odbcConnect("OraLSH", <user>, <password>))
 odbcQuery (channel, "select sysdate from dual")
 sqlGetResults(channel, as.is=FALSE, errors=FALSE, max=1, buffsize=1,
nullstring=NA, na.strings="NA", believeNRows=TRUE, dec=getOption("dec"))
              SYSDATE
1 2010-01-24 15:10:02

but what if I dont know the rowsize(max=1) before hand

Thanks,
Arun

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:19:13+00:00Added an answer on May 16, 2026 at 6:19 am

    believeNRows=FALSE seems to be the key. Best to use it when opening the connection:

    db <- odbcConnect(dsn=”testdsn”, uid=”testuser”, pwd=”testpasswd”, believeNRows=FALSE )

    When testing with unixODBC’s isql, it reports SQLRowCount to be 4294967295 (even if there’s just one row) on 64bit Linux while it reports -1 on 32 bit Linux. This is probably an optimization as it enables quicker answers. It saves the database the burden of retrieving the complete response data set immediately. E.g. there might be lots of records while only the first few hits will ever be fetched.

    4294967295 is (2^32)-1 which is the maximum value for an unsigned int, but will be tretated as -1 with a signed int. Thus R complains on a vector with negative length.
    So I assume it’s an issue about signed vs. unsigned integer (or sizeof(long) between 32 and 64 bit).

    Setting believeNRows=FALSE solved the issue for me so I can use the same R code on both systems.

    BTW: I’m using R 2.10.1, RODBC 1.3.2, unixODBC 2.3.0 with Oracle 10.2.0.4 on Linux 64 bit.
    Be sure to use

    export CFLAGS=”-DBUILD_REAL_64_BIT_MODE -DSIZEOF_LONG=8 -fshort-wchar”

    when doing configure for unixODBC as the Oracle ODBC driver expects REAL_64_BIT_MODE, not LEGACY_64_BIT_MODE.

    And be aware of internationalization issues: R uses $LANG while Oracle uses $NLS_LANG.

    I experienced problems with UTF8 so I use e.g.

    LANG=en_US; NLS_LANG=American_America

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A question about this R code: library(RODBC) ch <- tryCatch(odbcConnect(RTEST), warning=function(w){print(FAIL! (warning));return(NA)}, error=function(e){print(paste(ERROR:,geterrmessage()));return(NA)}) df
I am trying to pull data from our Oracle datamart into R using RODBC.
Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a
I know I can use the RODBC library for accessing excel (.xls) docs from
I've a question about using sqlSave. How does R map RODBC data in the
Installing the RODBC package on Ubuntu is a bit of a kludge. First I
RODBC is the main library in R to import data from a database into
I have created a data frame from a SQL query using the RODBC package.
I'm using R to read some data from a MySQL database using the RODBC
With functionality from the RODBC package, I have successfully created an ODBC but receive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.