Learn R Programming

RODBCDBI (version 0.1.1)

dbWriteTable,ODBCConnection,character,data.frame-method: Write a local data frame or file to the database.

Description

Write a local data frame or file to the database.

Usage

"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

Run this code
## 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)

Run the code above in your browser using DataLab