Learn R Programming

hkex.api (version 0.1)

prepInsertSQL: A Function to Generate a List of SQL statements from Dataframe.

Description

prepInsertSQL returns a list of insert SQL statements

Usage

prepInsertSQL(tableName = "", df = NULL, quote = NULL)

Arguments

tableName
a table name
df
dataframe that provides data
quote
(Optional) it is a vector indicates whether a data element should be quoted or not. 1 means quoted while 0 means not.

Details

The function is to generate insert SQL statements with data.frame data

Examples

Run this code
## Not run: 
#    testData=data.frame(name=c("peter","john"), age=c(18,23))
#    sqlStatement=prepInsertSQL(tableName="student", testData, quote=c(1,0))
# ## End(Not run)

Run the code above in your browser using DataLab