Skip to contents

Create SQL Tuples from Data Frame

Usage

dataFrameToSqlTuples(newData)

Arguments

newData

a data frame

Value

vector of character strings each of which represents one row in

newData

Examples

x <- data.frame(
  name = c("Peter", "Paul"), 
  birthday = as.POSIXct(c("1981-12-13", "2003-01-16"))
)

setCurrentSqlDialect("msaccess")
dataFrameToSqlTuples(x)
#> [1] "('Peter',#1981-12-13#)" "('Paul',#2003-01-16#)" 

# Note that the representation of a date and time is different in MySQL
setCurrentSqlDialect("mysql")
dataFrameToSqlTuples(x)
#> [1] "(\"Peter\",'1981-12-13')" "(\"Paul\",'2003-01-16')"