dbSendUpdate
is used to send a data-altering statement to a MonetDB database,
e.g. CREATE TABLE
or INSERT
. As a convenience feature, a placeholder
(?
character) can be used in the SQL statement, and bound to parameters given
in the varargs group before execution. This is especially useful when scripting
database updates, since the parameters will be automatically quoted.
The dbSendUpdateAsync
function is used when the database update is called from
finalizers, to avoid very esoteric concurrency problems. Here, the update is not guaranteed
to be immediately run. Also, the method returns immediately.dbSendUpdate( conn, statement, ..., async=FALSE )
dbSendUpdateAsync
? Defaults to FALSE
.TRUE
if the update was successful.dbSendQuery
# connect to MonetDB
conn <- dbConnect(MonetDB.R(), "monetdb://localhost/acs")
# create table
dbSendUpdate(conn, "CREATE TABLE foo(a INT,b VARCHAR(100))")
# insert value, bind parameters to placeholders in statement
dbSendUpdate(conn, "INSERT INTO foo VALUES(?,?)", 42, "bar")
Run the code above in your browser using DataLab