[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.

Marc Schwartz marc_schwartz at me.com
Sun Dec 20 22:28:58 CET 2009


On Dec 19, 2009, at 11:39 AM, Alex Chelminsky wrote:

>
> I have compiled and linked a 64 bit version of R (R 2.9.2) and the
> corresponding unix ODBC 64 bit package
>
> The red highlighted text below is the error I'm getting trying to when
> invoking a sqlQuery
>
>> library(RODBC)
>> channel <- odbcConnect("OraLSH", <user>, <password>)
>> sqlQuery(channel,"select sysdate from dual")
> Error in .Call(C_RODBCFetchRows, attr(channel, "handle_ptr"), max,
> buffsize,  :
>  negative length vectors are not allowed
>> close(channel)
>> q()
>
> Any suggestions are greatly appreciated.



Given that you were able to connect to your server successfully, it  
tends to narrow the possible issues.

Try using:

   sqlQuery(channel, "select sysdate from dual", rows_at_time = 1)

If you are using RODBC version 1.3-0 or newer, the default for  
rows_at_time is now 100, which has caused some problems with query  
results. Setting it to 1 (the former default value) seems to help.

Also, if you are using Oracle (presumption based upon using "OraLSH"),  
you might try using 'case = "toupper"' in the sqlQuery() call as well.

If the above does not help and you are using Oracle and have the  
InstantClient installed, try your queries using that from the CLI. If  
that works, then the underlying Oracle system configuration has been  
set correctly and helps to further isolate the problem to the R/RODBC  
combination. If not, then you have some underlying configuration issue  
to resolve.

BTW, we won't see the 'red highlighted text' here, as the list is  
plain text only, not HTML or RTF.

Last, but not least, R version 2.10.1 is the currently supported  
stable release of R.

HTH,

Marc Schwartz




More information about the R-help mailing list