dput(head(dat,10))
structure(list(DATE = c("14-04-2013 00:02:30", "14-04-2013 00:03:00",
"14-04-2013 00:03:30", "14-04-2013 00:04:00", "14-04-2013 00:04:30",
"14-04-2013 00:05:00", "14-04-2013 00:05:30", "14-04-2013 00:06:00",
"14-04-2013 00:06:30", "14-04-2013 00:07:00"), LPAR = c("server1",
"server1", "server1", "server1", "server1",
"server1", "server1", "server1", "server1",
"server1"), ENT = c("0.50", "0.50", "0.50", "0.50", "0.50",
"0.50", "0.50", "0.50", "0.50", "0.50"), USR_SYS_CPU_PCT = c(73L,
74L, 75L, 75L, 72L, 73L, 74L, 75L, 75L, 74L), ENT_PCT = c(345.6,
397.7, 394.2, 418.6, 349.2, 358.9, 585.7, 443.8, 464.9, 483.1
), PHYSICAL_CPU_USED = c(1.73, 1.99, 1.97, 2.09, 1.75, 1.79,
2.93, 2.22, 2.32, 2.42)), .Names = c("DATE", "LPAR", "ENT", "USR_SYS_CPU_PCT",
"ENT_PCT", "PHYSICAL_CPU_USED"), row.names = c(NA, 10L), class = "data.frame")
I am trying to insert dat data frame to an existing oracle table called VMSTAT. I am doing to this insert:
library(RODBC)
ch=odbcConnect("<dsn name>",pwd = "<password>")
sqlSave(ch,dat, tablename="VMSTAT",append=T)
odbcClose(ch)
not working. My R session is crashing. The VMSTAT table has the same column names as the data frame. Has anybody try to insert data frames to Oracle table, any help is really appreciated?
pwd = "<password>)
. Is that a typo from copying and pasting onto the site or is it in your code? – David Robinson Apr 15 '13 at 14:48T
a valid synonym forTRUE
in theappend
argument? (I have no idea... just looks a bit odd) – Alex Poole Apr 15 '13 at 15:43append
was OK, it was whether it should beappend=TRUE
rather thenappend=T
(as the manual suggests, maybe). – Alex Poole Apr 15 '13 at 15:50