Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ODBC Driver issue with Oracle datasources


View products that this article applies to.

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

↑ Back to the top


Solution

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

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

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 3103851
Revision : 1
Created on : 1/7/2017
Published on : 11/1/2015
Exists online : False
Views : 63