Description Usage Arguments Details Examples
View source: R/HelperFunctions.R
This function sends the data in a data frame or ffdf to a table on the server. Either a new table is created, or the data is appended to an existing table.
1 2 | insertTable(connection, tableName, data, dropTableIfExists = TRUE,
createTable = TRUE, tempTable = FALSE, oracleTempSchema = NULL)
|
connection |
The connection to the database server. |
tableName |
The name of the table where the data should be inserted. |
data |
The data frame or ffdf containing the data to be inserted. |
dropTableIfExists |
Drop the table if the table already exists before writing? |
createTable |
Create a new table? If false, will append to existing table. |
tempTable |
Should the table created as a temp table? |
oracleTempSchema |
Specifically for Oracle, a schema with write priviliges where temp tables can be created. |
This function sends the data in a data frame to a table on the server. Either a new table is created, or the data is appended to an existing table.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
connectionDetails <- createConnectionDetails(dbms = "mysql",
server = "localhost",
user = "root",
password = "blah",
schema = "cdm_v4")
conn <- connect(connectionDetails)
data <- data.frame(x = c(1, 2, 3), y = c("a", "b", "c"))
insertTable(conn, "my_table", data)
dbDisconnect(conn)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.