dbWriteTable: Write a local data frame or file to the database.

Description Usage Arguments Examples

Description

Write a local data frame or file to the database.

Usage

1
2
3
## S4 method for signature 'ODBCConnection,character,data.frame'
dbWriteTable(conn, name, value,
  overwrite = FALSE, append = FALSE, ...)

Arguments

conn

a ODBCConnection object, produced by dbConnect

name

a character string specifying a table name. ODBCConnection table names are not case sensitive, e.g., table names ABC and abc are considered equal.

value

a data.frame (or coercible to data.frame) object or a file name (character). when value is a character, it is interpreted as a file name and its contents imported to ODBC.

overwrite

logical. Should data be overwritten?

append

logical. Should data be appended to an existing table?

...

additional arguments passed to the generic.

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(DBI)
con <- dbConnect(RODBCDBI::ODBC(), dsn="test", user="sa", password="Password12!")
dbWriteTable(con, "mtcars", mtcars, overwrite=TRUE)
dbReadTable(con, "mtcars") 
dbDisconnect(con)

## End(Not run)

teramonagi/RODBCDBI documentation built on May 31, 2019, 8:37 a.m.