dbExecute2: Execute a SQL statement on a database connection with...

Description Usage Arguments Value See Also

View source: R/IO_databases.R

Description

A wrapper around dbExecute that catches errors and attempts to execute the SQL statement up to repeats before giving up if the database was locked.

Usage

1
dbExecute2(con, SQL, verbose = FALSE, repeats = 10L, sleep_s = 5, seed = NA)

Arguments

con

A DBIConnection or SQLiteConnection object.

SQL

A character string or vector of character strings. The SQL statement(s) to execute on con. If SQL is a vector of character strings, then the loop across individual executions is wrapped in a transaction.

verbose

A logical value.

repeats

An integer value. The maximum number of failed attempts to execute the SQL statement(s) if the database is locked.

sleep_s

A numeric value. The average number to sleep before attempting to execute the SQL statement(s) if the database was locked.

seed

An R object. Passed to set.seed if not NA.

Value

A logical value. TRUE if the execution of the SQL statement(s) did not error out.

See Also

dbExecute


Burke-Lauenroth-Lab/rSFSW2 documentation built on Aug. 14, 2020, 5:20 p.m.