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 fields and additionally performs checks for NA's in required variables, over-length 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, ...)If successful, the ids of the newly added database records (invisible).
connection.
The name of the table to which the data frame is to be loaded.
A dataframe to be loaded to the database.
Should new db present fields be added to the data.frame before it is loaded?.
Should a new column should be added for the database id?
Should the row names be loaded as a separate column? (unlike the original dbWriteTable, default is FALSE).
should the table primary key's sequence be updated to the highest id value +1? (Postgres specific).
other parameters passed to dbWriteTable.