create_table_via_temp_file: Writes a dataframe to a new table via a temp file

Description Usage Arguments

View source: R/create_table_via_temp_file.R

Description

This functionalizes a method of loading data into a local database that has worked as opposed to the other methods. To prevent errors in getting the nchar counts for the VARCHAR portion of the SQL statement, all true NAs are converted to "NA" at the beginning of the script. The temp file is a text file and a delimiter can be customized. The temp file is also unlinked at the end of execution. The column names are removed from the temp file before writing to avoid collisions with the column names of the empty table that will be created.

Usage

1
2
3
4
5
6
7
create_table_via_temp_file(
  dataframe,
  table_name,
  dbname,
  schema = NULL,
  delimiter = "\t"
)

Arguments

dataframe

dataframe to write to table

table_name

name of the table

dbname

name of database to be written to

schema

optional.

delimiter

delimiter used to write to a file and copy the contents of the file in the the SQL.


patelm9/seagull documentation built on July 19, 2020, 5:52 a.m.