dbWriteTable,DatabaseConnectorConnection,character,data.frame-method | R Documentation |
Writes, overwrites or appends a data frame to a database table, optionally
converting row names to a column and specifying SQL data types for fields.
New code should prefer dbCreateTable()
and dbAppendTable()
.
## S4 method for signature 'DatabaseConnectorConnection,character,data.frame' dbWriteTable( conn, name, value, overwrite = FALSE, append = FALSE, temporary = FALSE, oracleTempSchema = NULL, tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"), ... )
conn |
A DBIConnection object, as returned by
|
name |
A character string specifying the unquoted DBMS table name,
or the result of a call to |
value |
a data.frame (or coercible to data.frame). |
overwrite |
Overwrite an existing table (if exists)? |
append |
Append to existing table? |
temporary |
Should the table created as a temp table? |
oracleTempSchema |
DEPRECATED: use |
tempEmulationSchema |
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created. |
... |
Other parameters passed on to methods. |
dbWriteTable()
returns TRUE
, invisibly.
If the table exists, and both append
and overwrite
arguments are unset,
or append = TRUE
and the data frame with the new data has different
column names,
an error is raised; the remote table remains unchanged.
An error is raised when calling this method for a closed
or invalid connection.
An error is also raised
if name
cannot be processed with dbQuoteIdentifier()
or if this results in a non-scalar.
Invalid values for the additional arguments row.names
,
overwrite
, append
, field.types
, and temporary
(non-scalars,
unsupported data types,
NA
,
incompatible values,
duplicate
or missing names,
incompatible columns)
also raise an error.
Other DBIConnection generics:
DBIConnection-class
,
dbAppendTable()
,
dbCreateTable()
,
dbDataType()
,
dbDisconnect()
,
dbExecute()
,
dbExistsTable()
,
dbGetException()
,
dbGetInfo()
,
dbGetQuery()
,
dbIsReadOnly()
,
dbIsValid()
,
dbListFields()
,
dbListObjects()
,
dbListResults()
,
dbListTables()
,
dbReadTable()
,
dbRemoveTable()
,
dbSendQuery()
,
dbSendStatement()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.