Hi,
The following code should work:
fields <- dbListFields(con, db.table.name)
reordered.names <- names(df)[match(fields, names(df))]
df <- df[ ,reordered.names]
But, you might want to try using the function 'dbWriteTable2' in the
'caroline' package. (In fact the three lines above have been co
Hello,
you can fetch the column names of a table with dbListFields and then
reorder or rename the data frame according to those.
If you want more specific help, provide an example (RSQLite would be a
good choice as database engine to make it easily reproducible for others).
Best regards,
A
hi
I need some help in dbWriteTable.
I'm not able to insert the rows in the table if the column order are not
same in the database and in the dataframe which i'm inserting. Also facing
issue if the table is already created externally and inserting it thru
dbWrite.
is there some way that we can
3 matches
Mail list logo