Error in sqliteSendQuery - table already exists

667 views
Skip to first unread message

Hannah Page

unread,
Sep 15, 2015, 7:46:32 AM9/15/15
to sqldf
Hi All -

Recently shifted from exclusively using SQL to now using R for analytics, so using sqldf as a crutch until fully up to speed with R. This error continues to rear its head after running sqldf commands and thought I would ask here. 

Error in sqliteSendQuery(con, statement, bind.data) : 
  error in statement: table `expend` already exists

After all sqldf code running smoothly for several days, this error is now preventing almost all sql queries from running. I found guidance here https://github.com/ggrothendieck/sqldf  and verified that it was not a case issue. 

Any help or redirection if someone has already answered would be tremendously helpful!

Thanks!

Gabor Grothendieck

unread,
Sep 15, 2015, 8:01:41 AM9/15/15
to sqldf
The error message says that you are trying to create a table which already exists.  You have a table in your database called "expend" and at the same time it is trying to mirror a data.frame of the same name to the database.  It is refusing to do this since, for safety, it will never implicitly clobber an existing table.   Drop the expend table from the database backend first (assuming you don't need it).

Generally, questions should contain self-contained reproducible examples and not just an error message.
Reply all
Reply to author
Forward
0 new messages