db.prepare: Prepare a SQL statement for evaluation

View source: R/db-eval.R

db.prepareR Documentation

Prepare a SQL statement for evaluation

Description

This is an internal function and not meant to be called outside the db package.

Usage

db.prepare(db, stmt, params)

Arguments

db

The database connection. An S4 object of class "database".

stmt

The SQL statement to evaluate. SQL parameters can be bound to the statement and are indicated by the '?' character.

params

A matrix, data.frame, or list of lists with parameters to bind the SQL stmt. Each row in the matrix or data.frame or each sublist in the list of lists corresponds to a single parameter set. The number of parameters in each parameter set should equal the number of '?' characters in the SQL statement. If multiple parameter sets are bound to the statement then the statement may not be a SELECT statement.

Value

A cursor that can be used by db.fetch


blueraleigh/db documentation built on Feb. 25, 2024, 9:13 a.m.