[R] Error in sqlCopy in RODBC

From: Brigid Mooney <bkmooney_at_gmail.com>
Date: Tue, 25 Nov 2008 18:36:10 -0500


Hi All,

I am trying to copy portions of tables from one SQL database to another, using sqlCopy in the RODBC package.

RemoteChannel = connection to remote database LocalChannel = connection to local database LocalTable = table in my local database to receive data from the remote database

query <- select query in SQL

sqlCopy(RemoteChannel, query, "LocalTable", destchannel=LocalChannel, safer=TRUE)

I am currently getting an error:
Error in sqlSave(destchannel, dataset, destination, verbose = verbose, :   table 'LocalTable' already exists

I need to append the data retreieved through the query, to the table LocalTable. It was my understanding that when safer=TRUE, it would append the new data to an existing table, or create a new table otherwise.

This error seems to suggest otherwise. Any ideas?

All your help is greatly appreciated!

        [[alternative HTML version deleted]]



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. Received on Tue 25 Nov 2008 - 23:39:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Nov 2008 - 10:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive