A Function to Generate a List of SQL statements from Dataframe.
prepInsertSQL
returns a list of insert SQL statements
prepInsertSQL(tableName = "", df = NULL, quote = NULL)
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. |
The function is to generate insert SQL statements with data.frame data
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.