[R] RODBC sqlSave / append problem (windows XP, R 2.13.2)
matthew-c.johnson at ubs.com
matthew-c.johnson at ubs.com
Thu Feb 16 22:48:10 CET 2012
Hi Taby,
i could not work out how to add to a table, so what i did was to kill
the old one and write a new one --
here is a snippet of my code:
# delete the old table
sqlDrop(con, sqtable="__mytable__") # note this will hang if the table
cannot be found
# insert the new table
sqlSave(con,as.data.frame(__myDF__),tablename="__mytable__",rownames=T,f
ast=T)
odbcClose(con) #Close connection to DB
best regards
mj
________________________________
From: taby gathoni [mailto:tabieg at yahoo.com]
Sent: 16 February 2012 23:29
To: Johnson, Matthew-C
Cc: R help
Subject: Re: [R] RODBC sqlSave / append problem (windows XP, R 2.13.2)
Hi Mj,
did you get a solution for this? I am having the same error
Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test,
:
missing columns in 'data'
I would appreciate if you can share the solution with me.
Kind regards,
Taby
________________________________
From: mattjo <matthew-c.johnson at ubs.com>
To: r-help at r-project.org
Sent: Monday, December 5, 2011 1:25 AM
Subject: [R] RODBC sqlSave / append problem (windows XP, R 2.13.2)
Dear All,
Using RODBC I have read in a (429 x 11) dataframe from Access, and would
like to append two columns of transformed data (429 x 2) to the original
table (thereby making it a 429 x 13 table). I would ideally like this to
be the same name etc as the original table in Access.
I have used the following command:
R>
sqlSave(con,as.data.frame(SA_data),tablename="Const_mats_8301_t1",rownam
es=T,fast=T, append=T)
And get the error:
Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test, :
missing columns in 'data'
Thanks in advance,
mj
Visit our website at http://www.ubs.com
This message contains confidential information and is
in...{{dropped:26}}
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
-------------- next part --------------
Visit our website at http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.
More information about the R-help
mailing list