Connecting to Oracle
DataSourceName = 'Ora11'
UserID = 'rene'
Password = 'rene'
library(RODBC)
conn_odbc <- odbcConnect(dsn = DataSourceName, uid = UserID, pwd = Password)
result <- sqlQuery(conn_odbc, 'select * from dba_tables', errors = TRUE)
odbcClose(conn_odbc)
# str(result)
result[c('OWNER', 'TABLE_NAME', 'STATUS')]
Connecting to Excel
library(RODBC)
if (file.exists('test.xls'))
suppress_output <- file.remove('test.xls')
df <- data.frame(
a = c(1, 2, 3),
b = c('foo', 'bar', 'baz')
)
xls <- odbcConnectExcel('test.xls', readOnly = FALSE)
sqlSave(
xls,
df,
rownames = FALSE,
append = FALSE
)
odbcClose(xls)