dbReplaceInTable: insert of replacement rows into a table

Description Usage Arguments Details See Also Examples

Description

The 'dbReplaceInTable()' method assumes that the table has been created beforehand, e.g. with [dbCreateTable()]. The default implementation calls [sqlReplaceInTableTemplate()] and then [dbExecute()] with the 'param' argument. Backends compliant to ANSI SQL 99 which use ‘?' as a placeholder for prepard queries don’t need to override it. Backends with a different SQL syntax which use '?' as a placeholder for prepared queries can override [sqlReplaceInTable()]. Other backends (with different placeholders or with entirely different ways to create tables) need to override the 'dbReplaceInTable()' method.

Usage

1

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name

Name of the table, escaped with [dbQuoteIdentifier()].

value

A data frame of values. The column names must be consistent with those in the target table in the database.

...

Other arguments used by individual methods.

row.names

Must be 'NULL'.

Details

The 'row.names' argument is not supported by this method. Process the values with [sqlRownamesToColumn()] before calling this method.

See Also

Other DBIConnection generics: dbAddIndex, dbAddPrimaryKey, dbDeleteAllRecords, dbDropTable, dbUpdateTable

Examples

1
2
3
4
5
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbCreateTable(con, "iris", iris)
dbUpdateTable(con, "iris", iris)
dbReadTable(con, "iris")
dbDisconnect(con)

schardtbc/DBIExt documentation built on June 7, 2019, 2:39 p.m.