create_table_from_data_frame {sqlHelpers}R Documentation

Generate a CREATE TABLE statement based on a data.frame, optionally execute the statement if con is not NULL.

Description

Generate a CREATE TABLE statement based on a data.frame, optionally execute the statement if con is not NULL.

Usage

create_table_from_data_frame(x, table_name, con = NULL)

Arguments

x

A data.frame.

table_name

A string, the name of the SQL table to create.

con

A database connection that can be passed to DBI::dbSendQuery/DBI::dbGetQuery.

Value

A string, the CREATE TABLE statement; or the results retrieved by DBI::dbSendQuery after executing the statement.

Examples

create_table_from_data_frame(x = iris, table_name = "test")

[Package sqlHelpers version 0.1.2 Index]