RODBC sqlSave not all columns

How to force sqlSave to write only a subset of columns.

I have a table (MS-Access), for example. columns A, B, C en D, and if I send the sqlSave command with a data frame with columns A, B and D (no C), I get the message:

Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test,  :
  missing columns in 'data'
Calls: sqlSave -> sqlwrite -> odbcUpdate

(The columns in my table are identified as optional)

I can add a dummy column to my data frame with the name C and the value NA and sqlSave will be happy, but is there any other way to do this? Can arguments be used sqlSave? I can not find them in the documentation.

+2
source share

Source: https://habr.com/ru/post/1757206/


All Articles