error message from sqldf

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

error message from sqldf

Ding, Yuan Chun
Dear R users,

I got the following error message from running sqldf code in R.   do you know how to fix it?  I read the sqldf package instruction and did not find a solution.

Thank you,

Ding

chr10 <- sqldf("select * from manifest where CHR==10")

UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 5407594),
overwrite = TRUE")
Error: Table chr10 exists in database, and both overwrite and append are FALSE


>





---------------------------------------------------------------------
-SECURITY/CONFIDENTIALITY WARNING-
This message (and any attachments) are intended solely f...{{dropped:22}}

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: error message from sqldf

José María Mateos-2
On Sat, Mar 10, 2018 at 09:30:42PM +0000, Ding, Yuan Chun wrote:
> chr10 <- sqldf("select * from manifest where CHR==10")
>
> UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 5407594),
> overwrite = TRUE")
> Error: Table chr10 exists in database, and both overwrite and append are FALSE

Could it be that `chr10` already exists when you try to run your code.
What about rewriting it as:

chr10 <- sqldf("select * from manifest where CHR==10", overwrite = TRUE)

Also, it seems to me that the second line is not closing the quotes
properly. Shouldn't this be correct instead?

UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 5407594",
                  overwrite = TRUE)

Cheers,

--
José María (Chema) Mateos
https://rinzewind.org/blog-es || https://rinzewind.org/blog-en

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.