dbWriteTable: dbWriteTable

Description Usage Arguments Value Examples

Description

Write, append or overwrite a data frame to a database table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'MonetDBConnection,character'
dbWriteTable(
  conn,
  name,
  value,
  overwrite = FALSE,
  append = FALSE,
  csvdump = FALSE,
  transaction = TRUE,
  temporary = FALSE,
  ...
)

Arguments

conn

A MonetDB.R database connection, created using dbConnect with the MonetDB.R database driver.

name

The name of the database table.

value

The dataframe that needs to be stored in the table

overwrite

Overwrite the whole table with dataframe. default False

append

Append dataframe to table

csvdump

Dump dataframe to a temporary CSV file, and then import that CSV file. Can be used for performance reasons. Default False

transaction

Wrap operation in transaction. Default: True

temporary

Create a temporary table instead of a 'real' table Default: False

Value

TRUE if the writetable command was successful

Examples

1
2
3
4
5
dbWriteTable(conn, "mtcars", mtcars[1:5,])
dbWriteTable(conn, "mtcars", mtcars[5:10,], overwrite=T)
dbWriteTable(conn, "mtcars", mtcars[11:15,], append=T)
dbWriteTable(conn, "mtcars", mtcars[11:15,], append=T, csvdump=T)
dbWriteTable(conn, "iris", iris, temporary=T)

MonetDB/MonetDB.R documentation built on Dec. 31, 2020, 3:18 p.m.