dbj-edit-tables: Modify data in a database table

Description Usage Arguments Details See Also Examples

Description

Read data from a table, write a data frame to a table or delete the content of a table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'JDBCConnection,character'
dbReadTable(conn, name, ...)

## S4 method for signature 'JDBCConnection,character,data.frame'
dbWriteTable(conn, name, value,
  create = TRUE, append = FALSE, truncate = FALSE, temporary = FALSE,
  row.names = NA, ...)

## S4 method for signature 'JDBCConnection,character'
dbTruncateTable(conn, name, ...)

Arguments

conn

A JDBCConnection object, as produced by dbConnect.

name

character vector of length 1 specifying the name of a table in the database

...

Other parameters passed on to methods.

value

the date frame to write to the table

create

a logical specifying whether to create a new table if it does not exist. Its default is TRUE.

append

a logical specifying whether to append to an existing table. Its default is FALSE

truncate

a logical specifying whether to truncate an existing table before appending. Its default is FALSE

temporary

TRUE if the table should be temporary

row.names

Either TRUE, FALSE, NA or a string.

If TRUE, always translate row names to a column called "row_names". If FALSE, never translate row names. If NA, translate rownames only if they're a character vector.

A string is equivalent to TRUE, but allows you to override the default name.

For backward compatibility, NULL is equivalent to FALSE.

Details

These methods use sql_dialect functions to generate SQL statments.

See Also

Other JDBCConnection methods: dbConnect,JDBCConnection-method, dbDisconnect,JDBCConnection-method, dbSendQuery,JDBCConnection,character-method, dbj-sql-generate, dbj-sql-quote, dbj-table

Examples

1
2
3
4
5
6
## Not run: 
dbWriteTable(con, iris)
dbReadTable(con, "iris")
dbTruncateTable(con, "iris")

## End(Not run)

hoesler/dbj documentation built on May 17, 2019, 4:36 p.m.