Create an encoding function which replaces single quotes with
two single quotes:
# first string is a single character consisting of single quote
# second string is two characters consisting of two single quotes
enc - function(x) gsub(', '', x)
dbGetQuery(con,sprintf(insert into dd (txt) values
It works. Thanks very much.
Best
On Mon, May 12, 2008 at 7:02 PM, Gabor Grothendieck
[EMAIL PROTECTED] wrote:
Create an encoding function which replaces single quotes with
two single quotes:
# first string is a single character consisting of single quote
# second string is two characters
Dear list,
I want to insert a recorde into a SQLite table by dbGetQuery(), but
there is a problem when the value contains quotation mark.
dd-data.frame(txt=c(having both ' and \ in character.,OK))
library(RSQLite)
Loading required package: DBI
con-dbConnect(dbDriver(SQLite),:memory:)
3 matches
Mail list logo