[R] sqlSave()

Felipe Carrillo mazatlanmexico at yahoo.com
Sat May 9 20:36:47 CEST 2009


Sorry, I'am resending it because I forgot to send my system info(below)

Hi all: 
I have created a MS Access table named 'PredictedValues' through the statement below:
myDB <- odbcConnectAccess("C:/Documents and Settings/Owner/Desktop/Rpond Farming.mdb",uid="admin",pwd="")    
sqlSave(myDB,PredictedValues,rownames=FALSE)
  close(myDB) 

But if I run the code again with new values I get the message below:
Error in sqlSave(myDB, PredictedValues, rownames = FALSE) : 
  table ‘PredictedValues’ already exists
and my new records don't get updated.

I was under the impression that 'sqlSave' would copy new data on top of the existing one or if the table didn't exist it would create one with the new values. I tried 'sqlUpdate' but my existing 'PredictedValues' didn't update. What am I doing wrong.
?
 

sessionInfo()
R version 2.9.0 (2009-04-17) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] graphics  grDevices datasets  tools     stats     grid      utils     methods   base     

other attached packages:
 [1] RODBC_1.2-5     forecast_1.23   tseries_0.10-11 quadprog_1.4-10 zoo_1.3-1       hexbin_1.17.0   xtable_1.5-5    lattice_0.17-22 plyr_0.1.8      ggplot2_0.8.3   reshape_0.8.0   proto_0.3-7    
[13] rcom_2.1-3      rscproxy_1.3-1 


Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA








More information about the R-help mailing list