# 导入FMCG超敏感和敏感商品 dim_username_dept <- read.table(file = "~/dm/cluster/yihaodianbao", #header = TRUE, sep = " ", #strip.white = TRUE, stringsAsFactors = FALSE) str(dim_username_dept) head(dim_username_dept) names(dim_username_dept) <- c("USER_NAME", "FULL_NAME", "EMAIL", "DEPT") ## Write Databases Tables library("DBI") library("ROracle") drv <- dbDriver("Oracle") con <- dbConnect(drv,"tangjingxiao1","cathy,123",dbname = "10.0.1.226:1521/edwstd01") # 回写到数据库的字段名称,一定要大写,否则在Oracle里识别不出来 names(dim_username_dept) <- toupper(names(dim_username_dept)) # 回写到数据库的表名,一定要大写 dbWriteTable(con, toupper("dim_username_dept"), dim_username_dept, row.names = FALSE) dbCommit(con) dbDisconnect(con)