Update a row in the "truffe" table of a database.
update_db_truffe.Rd
This function updates a row in the "truffe" table of a database using an SQL UPDATE query.
Arguments
- conn
A connection to the database.
- idtruffle
The identifier of the truffle to update.
- idoak
The identifier of the oak tree associated with the truffle.
- date_found
The date when the truffle was found.
- weight
The weight of the truffle.
- comment
The comments associated with the truffle.
- estimation
The estimation of the truffle.
Value
The function does not return any value, but it updates the corresponding row in the "truffe" table of the database.
Examples
conn <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# Create a truffle table in the database
DBI::dbWriteTable(
conn,
"truffe",
data.frame(
idtruffle = "156",
idoak = "15",
date_found = as.numeric(as.Date("2020/02/02")),
weight = 12,
estimation = 1,
comment = "Comment"
)
)
update_db_truffe(
conn,
idtruffle = "156",
idoak = "15",
date_found = as.numeric(as.Date("2020/02/02")),
weight = 22,
estimation = 0,
comment = "It's good!"
)
#> UPDATE db truffe