Description Usage Arguments Examples
Inserts multiple data records into an SQL table directly from a data.frame
.
1 |
con |
SQL database connection object |
x |
|
.table |
name of the table into which the recored is inserted |
.verbose |
verbose level |
.dump |
logical or character vector that indicates if the insertion query should be only dumped into a file. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # connect to sample database
con <- .dbSampleConnection()
dbGetQuery(con, 'SELECT * FROM test')
# insert single record
df <- data.frame(a = 1:3, b = letters[1:3], c = c(1.5, NA, 6.5))
id <- dbINSERTx(con, df, .table = 'test')
id
# query table again
dbGetQuery(con, 'SELECT * FROM test')
# clean up
dbEMPTY(con, 'test')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.