Skip to content
Back to formatted view

Raw Message

Message-ID: <f8e6ff0504112509126eeb3aa4@mail.gmail.com>
Date: 2004-11-25T17:12:11Z
From: Hadley Wickham
Subject: Searching for a string in RSQLite
In-Reply-To: <fbubq0984n88mh6eb4aq12pdk3jfmgjbfg@4ax.com>

> I'd like to search for a particular string in an SQLite database using
> RSQLite, but I'm running into problems constructing the query
> properly, because of embedded quotes and parens in the string.

You may find dQuote() and sQuote() to be helpful, but a better
solution might be to ask the developers of the RSQLite package to add
R functions that call the SQLite api functions sqlite_exec_printf()
and sqlite_get_table_printf() which automatically escape single quotes
(among other things, http://www.sqlite.org/c_interface.html)

Hadley