Re: [R] Insert a recorde into a table using SQL

2008-05-12 Thread ronggui
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 charact

Re: [R] Insert a recorde into a table using SQL

2008-05-12 Thread Gabor Grothendieck
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) valu