String[] args={"somebaldingguy"};
rawQuery("SELECT _id, title FROM books WHERE author=?", args);The string array elements replace the question mark placeholders. SQLite handles quotation rules for strings for you, so you do not have to worry about embedded quotes or apostrophes. On Tue, Dec 21, 2010 at 2:34 PM, Tobiah <[email protected]> wrote: > I am unable to find an example of how to use the 'selection args' in the > second argument to rawQuery: > > public Cursor rawQuery (String sql, String[] selectionArgs) > > Can someone explain what they would be for and how to use them? > > Thanks, > > Tobiah > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

