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 4034436
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:58:18+00:00 2026-05-20T11:58:18+00:00

I receive this exception bind or column index out of range in this line:

  • 0

I receive this exception “bind or column index out of range” in this line:

Cursor cursor = db.query(TABLE_NAME, null, ID, new String[] { id }, null, null, null);

I want to check if the given id exists in the database, but always the query throw this exception and I don’t know what is wrong. I tried with this and the exception it’s the same:

Cursor cursor = db.query(TABLE_NAME, null, ID+" = ?", new String[] { id }, null, null, null);

This is the method I’ve programmed. If there is something wrong here, please, tell me:

public boolean existsAcc(String id)
    {
        //Check the parameters
        if (id == null)
        {
            throw new IllegalArgumentException(
                    "The id parameter cannot be null");
        }
        SQLiteDatabase db = getReadableDatabase();

        Cursor cursor = db.query(TABLE_NAME, null, ID, new String[] { id }, null, null, null);

        if (!cursor.moveToFirst())
        {
            cursor.close();
            return false;
        }

        cursor.close();

        return true;
    }
  • 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-20T11:58:19+00:00Added an answer on May 20, 2026 at 11:58 am

    I don’t know why Chirag deleted his answer, but he was rigth. Changing

    Cursor cursor = db.query(TABLE_NAME, null, ID, new String[] { id }, null, null, null);
    

    to

    Cursor cursor = db.query(TABLE_NAME, null, ID + " = '" + id + "'", null, null, null, null);
    

    does the trick.

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

Sidebar

Related Questions

I'm having a problem where I receive this error: Exception in thread main java.lang.NullPointerException
Hello im tryin to use Twitter with OAuth but i receive this exception Authorization
I receive this exception when I try to run a jar file java.lang.ClassNotFoundException: javax.servlet.Servlet
i receive this exception after calling the following method. And it only comes when
I recevie 0 errors but I get this in the console: >Exception in thread
I receive this error when I click on the section of my Tab-Bar application
I am using an broadcast receiver for Intent.ACTION_BATTERY_CHANGED. Rate at which I receive this
I want to raise an event from a .NET class, and receive this event
Due to a sad situation I receive HTML like this: <p>Perform the following commands:
I have a ListView set with a adapter. This adapter receive a list 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.