1
如何重寫(複印件)列到現有的數據庫如何重寫(複印件)列到現有的SQLite數據庫
我已經數據庫中名爲db.sqlite
r.memory.data <- data.frame(id=seq(1,10),year=paste0("200",0:9),name=letters[1:10],mark=rbinom(10,1,0.5),label=letters[1:10])
con <- dbConnect(dbDriver("SQLite"), dbname = "C:/ ...db.sqlite")
list.tab <- dbListTables(con)
list.tab
給"data" "sqlite_data"
tdf <- dbReadTable(con,"data")
給出:
[1] id year name mark label
<0 rows> (or 0-length row.names)
我想和數據幀r.memory.data與已命名的列重寫現有的數據庫(「數據」)作爲上述(空列)看到
嘗試重寫(複製數據):
query <- paste0("INSERT INTO data SELECT * FROM r.memory.data")
dbSendQuery(con, query)
給出了錯誤:
Error in sqliteSendQuery(con, statement) :
error in statement: no such table: r.memory.data
我是新來的SQLite,謝謝。 – Maximilian