dbWriteTable2 | R Documentation |
This is wrapper for dbWriteTable written with the the primary improvements focusing on database import into an existing table definition schema. The function matches and rearranges columns of the dataframe to database feilds and additionally performs checks for NA's in required variables, overlength strings, and type mismatches. There also exists support for updating of the PostgreSQL specific sequence for tables with auto incrementing primary keys.
dbWriteTable2(con, table.name, df, fill.null = TRUE, add.id=TRUE,
row.names=FALSE, pg.update.seq=FALSE, ...)
con |
connection. |
table.name |
The name of the table to which the data frame is to be loaded. |
df |
A dataframe to be loaded to the database. |
fill.null |
Should new db present fields be added to the data.frame before it is loaded?. |
add.id |
Should a new column should be added for the database id? |
row.names |
Should the row names be loaded as a seperate column? (unlike the original dbWriteTable, default is FALSE) |
pg.update.seq |
should the table primary key's sequence be updated to the highest id value +1? (Postgres specific) |
... |
other parameters passed to dbWriteTable. |
If successful, the ids of the newly added database records (invisible)
dbWriteTable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.