Name: ID TAGCODE FAULTID MATRIX CREATETIME VALID TYPE
Data Type:Number varchar2 number BLOB date varchar2 Number
我写了这段代码来实现我的目标:
library(RODBC)
channel<-odbcConnect(dsn="bigdata",uid="swapdata",pwd="swap123",believeNRows=FALSE)
ID<-2
TAGCODE<-c("test1")
FAULTID<-1
CREATETIME<-as.POSIXct(strptime("2011-03-27 01:30:00", "%Y-%m-%d %H:%M:%S"))
VALID<-c("t")
TYPE<-1
MATRIX<-paste(readBin("test.csv",what="raw",n=1e6),collapse="")
sql<-paste("insert into T_FORECAST_AI_LIBRARY values(",ID,",'",TAGCODE,"',",FAULTID,",'",MATRIX,"','",CREATETIME,"','",VALID,"',",TYPE,"",sep="")
sqlQuery(channel,sql)
MATRIX只是csv
格式的文件,矩阵的大小约为28 kb
当我运行代码时,R会话将被中止,
答案 0 :(得分:0)
在您的计算机上安装ODBC驱动程序连接器。从这里下载http://www.oracle.com/technetwork/database/windows/downloads/index-096177.html并使用您的oracle凭证对其进行配置,然后重试。