On 29.08.2012 20:32, Ivan Alves wrote:
Dear Uwe,
Many thanks for the reply.
On 1, the problem is that RODBC on 32 bit ' interprets' factors correctly, whereas on 64
bit it gives the error below. On both systems forcing characters (via colClasses =
"character" in read.csv), results in no problems. I still see this as a
problem of implementation on 64 bit.
If that is really an ODBC difference, also something to be reported with
2) below.
Best,
Uwe Ligges
On 2, many thanks, once I gather the courage to address Prof. Ripley I will
send him a recollection of my experience.
Kind regards,
Ivan
On 29 Aug 2012, at 15:08, Uwe Ligges <lig...@statistik.tu-dortmund.de> wrote:
On 24.08.2012 21:53, Ivan Alves wrote:
Hi all,
I am encountering an RODBC problem in R 2.15.1 in windows 64 bit which I do not
encountered in the same set up in windows 32 bit (the latest binary version of
RODBC in both cases from the same depository gotten by
install.packages(‘RODBC’), Oracle ODBC client software installed in 64 and 32
bit respectively)
1. The code looks like
library(RODBC)
credentials <- read.csv("~/credentials.csv", head=T, row.names=1)
db <- odbcConnect(dsn="DSN", uid=credentials["DSN", "username"], pwd=credentials["DSN",
"password"], rows_at_time=1024)
on which the odbcConnect call fails with the following error code
Error in nchar(uid) : 'nchar()' requires a character vector
(
credentials are processed correctly and credentials["DSN", "username"]
correctly returns – by the way a factor –
[1] _username_
Levels: …
).
When I run the equivalent call with direct arguments
db <- odbcConnect("DSN", uid="_username_", pwd="_password_", rows_at_time=1024)
it works just fine. Furthermore both work just fine on windows 32 bit, or on both
systems when the colClasses = "character" option is used. Is this perhaps a
problem with RODBC in 64 bit when dealing with factors that is not a problem in 32 bit?
I think 32-bit and 64-bit behave the same way (but you have not compared
exactly), reading
credentials <- read.csv("~/credentials.csv", head=T, row.names=1)
results in factors for username and password that have to be converted to
character. It is unrelated to RODBC.
2. Furthermore (and as reported in
http://stackoverflow.com/questions/3407015/querying-oracle-db-from-revolution-r-using-rodbc),
there are issues with using sqlQuery without the option believeNRows=FALSE, as
RODBC seems to still have issues with signed vs. unsigned integer (or
sizeof(long) between 32 and 64 bit.
Don't know, but that is something you may want to report (preferrably including
patches) to the package maintainer.
Uwe ligges
Any chance the problems have the same source in RODBC code and could be
addressed in the near future (after apparently years of making difficult the
transition to 64 bit for work with Oracle servers)? (is there an implicit
encouragement to use RJDBC when combining 64 bit R use and Oracle databases?)
Many thanks in advance for any guidance.
Ivan
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.