我有一个列表,该列表来自MariaDB中的一个表。在表中进行更改后,我尝试使用列表中的列更新表中的所有列。 db.WriteTable()仅更新一组特定的列
答案 0 :(得分:0)
如果您想覆盖所有内容,那为什么不先清空表呢?然后写新数据?
# Library
library(odbc)
# Creating connection
my_connection <- dbConnect(drv = odbc::odbc(),
Driver = "SQL Driver",
server = 00.00.00.00\\\\mycoolservername,1434,
database = "databasename",
uid = "user",
pwd = "password")
# Removing old data
query = "DELETE FROM my_schema.my_table"
dbGetQuery(my_connection, query)
# Inserting new data
dbWriteTable(my_connection, schema = "my_schema", name = "my_table", value = my_dataframe)