Alex Chelminsky
2009-Dec-19 17:39 UTC
[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.
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. Alexander Chelminsky Principal CSC GBS | p: +1 781 290 1620 | f: +1 781 890 1208 | m: +1 617 650 5453 | achelminsky at csc.com | www.csc.com This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
Marc Schwartz
2009-Dec-20 21:28 UTC
[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.
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
Eric Ma
2010-Jan-20 04:04 UTC
[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.
I am having the exact same error, and the suggested work-around does not help. My env is: 64-bit SUSE Linux v 10.1 on Xeon processors. gcc and gfortran version is 4.1.2 64-bit R 2.10.1 compiled from soure using CC="gcc -m64" etc. 64-bit unixODBC driver manager 2.2.14 compiled from source Oracle Instant Client ODBC driver for Linux x86_64 11.2.0.1.0 RODBC 1.3-1 installed from within R. ODBC_INCLUDE and ODBC_LIBS point to the unixODBC include and the .so directories unixODBC isql test is successful. I know it is a 32-bit and 64-bit mismatch, and the issue is in R or RODBC. How can I confirm the 32- vs. 64-bit version of R and RODBC? Thanks, 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--tp975458p1018138.html Sent from the R help mailing list archive at Nabble.com.