I have following table:
structure(list(ID = c(9L, 9L, 8L, 8L, 8L, 8L, 8L, 8L, 13L), price= c(21040L,
21056L, 63278L, 63280L, 63296L, 63312L, 63328L, 63344L, 32176L
)), class = "data.frame", row.names = c(NA, 9L))
I want to save it using following code
dbSendUpdate(CONNECTION,paste("INSERT INTO DATABASE (Date, Id, Price) VALUES (cast(TIMESTAMP 'NOW' as date), ",
df$ID,
", ",
df$price,
");"))
However, when I ran this code, only the first row is saved to database. How can I save the whole table with one command?