sql_createtable: Creates a new table within a database

Description Usage Arguments Examples

View source: R/sql_createtable.R

Description

Creates a new table within a database

Usage

1
sql_createtable(tbl_name, col_names, col_types, primary_key = -1)

Arguments

tbl_name

- the name of the table to be made

col_names

- a vector of the desired column names

col_types

- a vector of the desired column types (length of col_names and col_types must be equal)

primary_key

- a vector with the columns to be included in the primary key (default is all of them)

Examples

1
2
3
sql_createtable("Table1", c("c1","c2"), rep("INTEGER",2), primary_key = "c1")
sql_createtable("Table2", c("c1","c2", "c3"), rep("INTEGER",3), primary_key = c("c1","c2"))
sql_createtable("Table3", c("c1","c2"), rep("INTEGER",2))

jeffchang5/SQLiter documentation built on May 19, 2019, 1:48 a.m.