upload_table: Copy a small local tibble/data.frame into a remote table.

Description Usage Arguments Details Examples

View source: R/upload_table.R

Description

This is a convenience wrapper for the DBI::dbWriteTable function.

Usage

1

Arguments

.conn

The connection object (needed to drop the table before 'compute' is called)

name

The name of the desired table. Can use dplyr::in_schema() to specify a table in a different schema than the one that was defined in the connection. Note: will be dropped and recreated if a table already exists.

data

Incoming tibble/data.frame

...

additional parameters passed through to DBI::dbWriteTable(), ie. field.types, overwrite = TRUE, temporary = TRUE, append = TRUE.

Details

Known issues: varchar fields are set to a length of 255 characters. Therefore, text fields with more than that must be truncated before calling this function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
conn <- connect_cdw()

demo <- mtcars

upload_table(demo, name = dplyr::in_schema("PHC_DB_DEV.REF", "DELETEME"), demo, overwrite = TRUE)

disconnect_cdw(conn)


## End(Not run)

RollieParrish/ccdm documentation built on Dec. 31, 2020, 4:26 p.m.