Re: [R] help in dbWriteTable

2011-12-02 Thread David M. Schruth
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

Re: [R] help in dbWriteTable

2011-12-02 Thread Andreas Borg
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