ODBC Driver issue with Oracle datasources

Problem

> library(RODBC) 

> ch <- odbcConnect("jcgi")

Cannot output the result 
> sqlQuery(ch,"select sysdate from dual") 
Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max, 
buffsize, : 
negative length vectors are not allowed

with 32bit oracle library

> library(RODBC) 
> ch <- odbcConnect("jcgi") 
Warning messages: 
1: In odbcDriverConnect("DSN=jcgi") : 
[RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver 
Manager]Can't open lib 
'/usr/lib/oracle/11.2/client/lib/libsqora.so.11.1' : 
/usr/lib/oracle/11.2/client/lib/libsqora.so.11.1: wrong ELF class: 
ELFCLASS32 
2: In odbcDriverConnect("DSN=jcgi") : ODBC connection failed

Solution

Add the option 'believeNRows = FALSE' in your odbcConnect() call. 

This option needs to be set when importing data from Oracle databases.
Properties

Article ID: 3103851 - Last Review: 1 Nov 2015 - Revision: 1

Feedback