Mike Pfeiff
2011-Dec-20 13:55 UTC
[R] RODBC Error: 'getCharCE' must be called on a CHARSXP
I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code: channel <-odbcConnect("some_dsn", uid="", pwd="") txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"' sqlQuery(channel, cat(txt,"\n"),errors=TRUE,) close(channel) However, I get the following error immediately after sqlQuery command: Error in odbcQuery(channel, query, rows_at_time) : 'getCharCE' must be called on a CHARSXP I believe my connection is good because I used the following commands to successfully view the columns: sqlColumns(channel, TableXYZ) There doesn't seem to be much info on "getCharCE" and/or "CHARSXP. Any guidance the group could provide this vey new user to R, would be greatly appreciated [[alternative HTML version deleted]]
On 20.12.2011 14:55, Mike Pfeiff wrote:> I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code: > > channel<-odbcConnect("some_dsn", uid="", pwd="") > txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"' > sqlQuery(channel, cat(txt,"\n"),errors=TRUE,)sqlQuery(channel, txt, errors=TRUE) seems more plausible (since cat returns NULL). Uwe Ligges> close(channel) > > However, I get the following error immediately after sqlQuery command: > > Error in odbcQuery(channel, query, rows_at_time) : > 'getCharCE' must be called on a CHARSXP > > I believe my connection is good because I used the following commands to successfully view the columns: > > sqlColumns(channel, TableXYZ) > > There doesn't seem to be much info on "getCharCE" and/or "CHARSXP. Any guidance the group could provide this vey new user to R, would be greatly appreciated > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Seemingly Similar Threads
- Unstable reproduce for potential issue with CHARSXP creation
- Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
- Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
- Using RODBC to use SQL queries
- read .csv from web from password protected site