dbxExecute: Execute a statement

View source: R/execute.R

dbxExecuteR Documentation

Execute a statement

Description

Execute a statement

Usage

dbxExecute(conn, statement, params = NULL)

Arguments

conn

A DBIConnection object

statement

The SQL statement to use

params

Parameters to bind

Examples

db <- dbxConnect(adapter="sqlite", dbname=":memory:")
DBI::dbCreateTable(db, "forecasts", data.frame(id=1:3, temperature=20:22))

dbxExecute(db, "UPDATE forecasts SET temperature = 20")

dbxExecute(db, "UPDATE forecasts SET temperature = ?", params=list(20))

dbxExecute(db, "UPDATE forecasts SET temperature = ? WHERE id IN (?)", params=list(20, 1:3))

dbx documentation built on June 22, 2024, 9:11 a.m.