paul.macmanus at gmail.com
2006-Dec-22 18:38 UTC
[Rd] bug in sqlSave with fast=F option (PR#9429)
Full_Name: Paul MacManus Version: 2.3.0 OS: Windows XP Submission from: (NULL) (216.90.169.253) See also R-help thread for October 18, 2006 --------------------------- Create a dataframe and save it to a database table "test" as follows: df <- data.frame(T=1, S=10) sqlSave(channel, df, "test", rownames=F) The table now looks like T S 1 10 If I create another dataframe and save as follows df <- data.frame(S=20, T=2) sqlSave(channel, df, "test", rownames=F, append=T) Then table "test" now looks like T S 1 10 2 20 The important point is that although S was the first column of df, sqlSave checked the column names and matched the corresponding columns of df and table "test". However, if I now create another dataframe and save it using the fast=F option as follows df <- data.frame(S=30, T=3) sqlSave(channel, df, "test", rownames=F, append=T, fast=F) the table test now looks like T S 1 10 2 20 30 3 In other words, sqlSave didn't check column names, it simply mapped column 1 to column 1 and column 2 to column 2. ------------------------- I'm using R 2.3.0 and package RODBC 1.1-7 on Windows XP with MS SQL Server
Please read how to report bugs: 1. sqlSave is not part of R's base packages, hence please do not submit a bug report here but ask the package maintainer of the corresponding package. 2. You have tested with an outdated version of R (2.4.1 is recent). Uwe Ligges paul.macmanus at gmail.com wrote:> Full_Name: Paul MacManus > Version: 2.3.0 > OS: Windows XP > Submission from: (NULL) (216.90.169.253) > > > See also R-help thread for October 18, 2006 > > --------------------------- > Create a dataframe and save it to a database table "test" as follows: > > df <- data.frame(T=1, S=10) > sqlSave(channel, df, "test", rownames=F) > > The table now looks like > > T S > 1 10 > > If I create another dataframe and save as follows > > df <- data.frame(S=20, T=2) > sqlSave(channel, df, "test", rownames=F, append=T) > > Then table "test" now looks like > > T S > 1 10 > 2 20 > > The important point is that although S was the first column of df, > sqlSave checked the column names and matched the corresponding columns > of df and table "test". > > However, if I now create another dataframe and save it using the > fast=F option as follows > > df <- data.frame(S=30, T=3) > sqlSave(channel, df, "test", rownames=F, append=T, fast=F) > > the table test now looks like > > T S > 1 10 > 2 20 > 30 3 > > In other words, sqlSave didn't check column names, it simply mapped > column 1 to column 1 and column 2 to column 2. > ------------------------- > > I'm using R 2.3.0 and package RODBC 1.1-7 on Windows XP with MS SQL Server > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel