rodbc

how to install RODBC on macOS Sierra 10.12.4

风格不统一 提交于 2019-12-13 12:41:57
问题 In R 3.4.0, install.packages('RODBC', type='source') fails on macOS 10.12.4. I also downloaded RODBC_1.3-15.tar.gz from CRAN and tried, R CMD INSTALL RODBC_1.3-15.tar.gz In both cases, I got "ODBC headers sql.h and sqlext.h not found". A discussion of this in Installation of RODBC/ROracle packages on OS X Mavericks says the following: To fix this, you need to download the latest version of iODBC (www.iodbc.org), and then unzip the file and set your header and library search paths to the

RODBC MS SQL access from Ubuntu using FreeTDS

百般思念 提交于 2019-12-13 11:39:51
问题 I'm trying to access MS SQL server hosted on my Windows box from an Ubuntu machine. I have a shiny app that access MSSQL that works fine on Windows. I want to host this with shiny server on Ubuntu so that others can access the webpage and provide their SQL server as input to the app. All of this works fine on Windows. Now I'm not able to get unixODBC working. I think I've got the odbc/freeTDS installation and configuration correct. I'm able to connect and query SQL DB instance from Ubuntu

create a table from a dataframe using RODBC

送分小仙女□ 提交于 2019-12-13 06:49:21
问题 I am connecting to a SQL Server using ODBC and want to create a table from a dataframe. Following RODBC vignette below is my code, library(RODBC) channel <- odbcConnect("DSN#", uid = "uname", pwd = "pwd") ana.cars.df <- data.frame(mtcars) sqlSave(channel, ana.cars.df) And below is the error that I am getting Error in sqlSave(channel, ana.cars.df) : 42000 102 [FreeTDS][SQL Server]Incorrect syntax near 'rownames'. [RODBC] ERROR: Could not SQLExecDirect 'CREATE TABLE ana.cars.df ("rownames"

unable to run sql query against oracle table in R

自作多情 提交于 2019-12-13 03:03:34
问题 I can run this query in sqlplus against an oracle table, it works I get results back: SELECT * FROM KEYNOTE_PRD WHERE KEYNOTE_PRD."Site"='High Frequency NY Traffic' but I try to same with the following code within R: tryCatch({ ch=odbcConnect("<id>",pwd = "<passwd>") sql<-c("SELECT * FROM KEYNOTE_PRD WHERE KEYNOTE_PRD."Site"='High Frequency NY Traffic'") res<-sqlQuery(ch, sql) },error = function(e) { print(odbcGetErrMsg(ch)) print("retrive or connect to the db") }) odbcClose(ch) It does not

Using R with RODBCext and RODBC to execute a SQL stored procedure

﹥>﹥吖頭↗ 提交于 2019-12-13 00:49:26
问题 I am using the RODBCext package and the RODBC package to execute a stored procedure in SQL server 2008 using R. If I use this code the stored procedure works. query <- "EXEC [dbo].[usp_SchoolMerge] @Number = ?, @Name = ?, @Type = ?, @Comments = ?, @DualEnrollment =?, @CEP = ?, @DistrictGuidId = ?, @ImportName = ?, @ImportID = ?" query <- gsub("[[:space:]]+", " ", query) con2 <- odbcConnect("database", uid="userid", pwd="password") for(i in 1:nrow(us11_12_00_school)) { sqlExecute(con2, query,

Rodbc error: Error in sqlSave(DataConnection, dataframeInput, tablename = tableNameString, : unable to append to table

爷,独闯天下 提交于 2019-12-12 19:08:53
问题 I am hit with a strange error that neither my IT support nor myself can explain, and it is related to saving from R back into oracle db using RODBC. specifically, I am hit with this error: Error in sqlSave(DataConnection, dataframeInput, tablename = tableNameString, : unable to append to table "aaa" I have a second table "bbb" that has exact same column and constraints as "aaa", and it is able to save the records correctly, so it does not look like an error due to number format, etc. has

RODBC Cannot allocate memory

对着背影说爱祢 提交于 2019-12-12 11:06:52
问题 Simple R script library(RODBC) odbChannel <- odbcConnect(dsn = "CTPRD03", uid = "BD_RPT_RO", pwd = "****") df.test <- sqlQuery(channel = odbChannel, query = "select * from DUAL;") df.test close(odbChannel) Produces the following error shiny@narc07shiny1dev:~/software> Rscript ./RODBC_SIMPLE_TEST.r Error in odbcQuery(channel, query, rows_at_time) : 'Calloc' could not allocate memory (18446744073709551616 of 22816 bytes) Calls: sqlQuery -> odbcQuery -> .Call Execution halted Warning message:

From Clause in RODBC Quotations - SAP HANA

久未见 提交于 2019-12-12 10:21:07
问题 I cannot seem to get the below FROM clause to work using RODBC's sqlQuery . I have taken the advice of @Lars Br. in terms of the quoting but it still does not work. I am I know the placeholder piece works as I have used this in qlikview Extracting Table from HANA using R So the below code works table <- sqlQuery(myconn, 'SELECT * FROM "_SYS_BIC"."mytable.TABLE/ALL_DATA"') But when I try to add the following (I am passing my date parameters in) table <- sqlQuery(myconn, 'SELECT * FROM "_SYS

rodbc character encoding error with PostgreSQL

二次信任 提交于 2019-12-12 09:38:05
问题 I'm getting a new error which I've never gotten before when connecting from R to a GreenPlum PostgreSQL database using RODBC. I've gotten the error using both EMACS/ESS and RStudio, and the RODBC call has worked as is in the past. library(RODBC) gp <- odbcConnect("greenplum", believeNRows = FALSE) data <- sqlQuery(gp, "select * from mytable") > data [1] "22P05 7 ERROR: character 0xc280 of encoding \"UTF8\" has no equivalent in "WIN1252\";\nError while executing the query" [2] "[RODBC] ERROR:

“first argument“ error when using shinyapps.io, rodbc to show sql query result in web

纵饮孤独 提交于 2019-12-12 04:26:02
问题 First of all, I need to use R to get SQL query result from HANA database, which I finish by using RODBC in Rstudio. Second of all, I need to share my code with others, which I use shinyapps.io to finish. However, I need to use shinyapps to show my SQL query result on other computers, which I have the following error message: error first argument is not an open rodbc channel I used the answer from R shiny RODBC connection Failing, but it still does not work. Here is my codes for ui.R and sever