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

Description Usage Arguments Value See Also

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
2
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/SoilWat_R_Wrapper documentation built on May 6, 2019, 8:52 a.m.