Maybe you should escape the single quotes something like " ' " id " ' "?
On Sep 17, 2013, at 6:03 PM, srecko joksimovic <sreckojoksimo...@gmail.com> wrote: > Hi, > > when I generate query using sqldf library, like this: > query = paste(paste("select * from tbl_user where student_id = ", id, > sep=""), " order by date_time", sep="") > > student <- sqldf(query) > > everything works fine in case the id is "21328", "82882", or something like > that. But, when id is something like "78789D", there is an error: > Error in sqliteExecStatement(con, statement, bind.data) : > RS-DBI driver: (error in statement: unrecognized token: "78789D") > > I tried replacing single quotes with double, but it still doesn't work... > > thanks, > Srecko > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. ______________________________________________ R-help@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.