You should make use of the rawQuery
method’s selectionArgs
parameter:
p_query = "select * from mytable where name_field = ?";
mDb.rawQuery(p_query, new String[] { uvalue });
This not only solves your quotes problem but also mitigates SQL Injection
.
More Related Contents:
- I am getting this error on my code [closed]
- Sqlite for Android
- How can I avoid concurrency problems when using SQLite on Android?
- How to store(bitmap image) and retrieve image from sqlite database in android? [closed]
- Best way to work with dates in Android SQLite [closed]
- How do I join two SQLite tables in my Android application?
- How can I create a user-defined function in SQLite?
- SQLite Android Database Cursor window allocation of 2048 kb failed
- Android SQLite: Update Statement
- How to delete SQLite database from Android programmatically
- Android error – close() was never explicitly called on database
- How do I create a database in android? [closed]
- Android SimpleCursorAdapter doesn’t update when database changes
- How to implement Export sqlite To excel/csv file in android?
- How to store and retrieve a byte array (image data) to and from a SQLite database?
- problem about sqlite database, no such table:
- SQLite Query in Android to count rows
- Using the LIMIT statement in a SQLite query
- sqlite encryption for android
- Attempt to reopen an already-closed object sqlitedatabase
- how to save image taken from camera and show it to listview – crashes with “IllegalStateException”
- How insert image in room persistence library?
- How to view data saved in android database(SQLite)?
- SQLite android column not found
- SQlite – Android – Foreign key syntax
- Inserting values to SQLite table in Android
- Queries with prepared statements in Android?
- SQLiteOpenHelper onUpgrade() Confusion Android
- Using COLLATE in Android SQLite – Locales is ignored in LIKE statement
- SQLite Foreign Key