Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6120389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:39:46+00:00 2026-05-23T15:39:46+00:00

My Android app is crashing with this error: E/AndroidRuntime( 315): Caused by: android.database.sqlite.SQLiteException: bind

  • 0

My Android app is crashing with this error:

E/AndroidRuntime(  315): Caused by: android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x3470a0
...
E/AndroidRuntime(  315):        at lee.medical.icu.dataentry.db.PatientInfoDbHelper.getTests(PatientInfoDbHelper.java:163)

It’s stumbling on this bit of code:

SQLiteDatabase db = dbHelper.getReadableDatabase();
String[] columns = {C_LOCATION, C_TESTS};
String selection = "? = '?' and ? = '?'";
String[] selectionArgs = {C_LAST, lastName, C_FIRST, firstName};
Cursor cursor = db.query(TABLE, columns, selection, selectionArgs,
        null, null, null); // line 163

What could this error mean?

(A couple of notes: C_LOCATION, C_TESTS, C_LAST, and C_FIRST are columns in my database. lastName and firstName are method arguments that are self-explanatory.)

Edit: I had to play around with antlersoft’s solution a bit to make it work. In case anyone else having the same problem stumbles upon this question, the solution in my case was to change the selection to:

String selection = C_LAST + " = ? and " + C_FIRST + " = ?"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:39:47+00:00Added an answer on May 23, 2026 at 3:39 pm

    Don’t put your ? in single-quotes for string arguments; in single quotes the ? is taken as a literal string and not as an argument placeholder– SQLite will know the type of the argument passed as ? and so you don’t have to quote it.

    The way you have written it there are four arguments and only two argument placeholders in your query and so the exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to catch an android.database.sqlite.SQLiteException: error code 5: database is locked exception with:
My Android app stores its SQLite database on the SD card, so that when
I'm new to android development. I can't figure out why this is crashing in
I've got an Android app which has a periodic background Service. I want this
i've developed an android app that's fetches an xml file and displays this data
This link describes my problem exactly: http://old.nabble.com/Android-database-corruption-td28044218.html#a28044218 There are about 300 people using my
I think my android app is leaking memory. I'm not absolutely sure that this
My Android app employs a particularly big computation which keeps crashing the system because
My android app has a two word app name, and the 2nd word doesn't
I'm building an Android app and I want to copy the text value of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.