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

  • SEARCH
  • Home
  • 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 5842731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:03:22+00:00 2026-05-22T12:03:22+00:00

friends, i have written following sqlite insert statement which seems to be wrong. before

  • 0

friends,

i have written following sqlite insert statement which seems to be wrong.
before inserting row i am checking if record exists then dont insert(ATM data is more than 600 records)

Reached max size for compiled sql statement cache for database.no space for this sql statement in cache.select 1 from atm where atmid=251 please change your sql statment to use “?” for bindargs, instead of

public void addAtm(ATM atm)
    {

db.execSQL("INSERT INTO " + AtmsTable.NAME + 
        "(" +AtmsTable.COL_ID + ","
        +AtmsTable.COL_BankID +"," 
        + AtmsTable.COL_BankNAME+","
        + AtmsTable.COL_BankPhone+","
        + AtmsTable.COL_BankAddress+","
        + AtmsTable.COL_BankCoordinates+","
        + AtmsTable.COL_BankCity+","
        + AtmsTable.COL_BankWebaddress+") Values (" 
        +atm.getAtmID()+","
        +atm.getBankID()
        + ",'" + atm.getBankName().trim()
        +"','" + atm.getPhone()
        +"','" + atm.getAddress()
        +"','" + atm.getCoordinates()
        +"','" + atm.getCity()
        +"','" + atm.getWebAddress()+ "');");

}

and

public boolean atmExists(int atmId)
    {
        OpenIfNotOpened();
         Cursor cursor = db.rawQuery("select 1 from " + AtmsTable.NAME  +" where " + AtmsTable.COL_ID + "=" + atmId,null);
               boolean exists = (cursor.getCount() > 0);
               cursor.close();
               return exists;
    }

and i am getting following error message

any help would be appreciated.

  • 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-22T12:03:23+00:00Added an answer on May 22, 2026 at 12:03 pm

    public void execSQL (String sql)

    Since: API Level 1 Execute a single
    SQL statement that is NOT a SELECT or
    any other SQL statement that returns
    data. It has no means to return any
    data (such as the number of affected
    rows). Instead, you’re encouraged to
    use insert(String, String,
    ContentValues), update(String,
    ContentValues, String, String[]), et
    al, when possible.

    just use:

    ContentValues vals = new ContentValues();
    vals.put(AtmsTable.COL_BankID, atm.getBankID());
    vals.put(AtmsTable.COL_BankNAME, atm.getBankName().trim());
    /...
    if(db.update(AtmsTable.NAME, vals, AtmsTable.COL_ID + "=?", new String[]{Integer.toString(atm.getAtmID())}) == 0){
      vals.put(AtmsTable.COL_ID, atm.getAtmID());
      db.insert(AtmsTable.NAME, null, vals);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Friends, I have written the following JavaScript to ascertain which row of an tabular
this is my algorithm that I have written it with my friends (which are
friends, i have written following layout code and buttons to be displayed on screen
I have written the following Midje test: (fact (followers-minus-friends ...name...) => [Dude] (provided (idset
I have written this query which returns a users friends and the friends on
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Greetings friends, In my MySQL database, I have 'MAB' table which contains information about
I have written the following code: #include <iostream> using namespace std; template <class T>
hi friends I have been working WCF since past one week. I have written
Hello friends I Have a float type variable ,which contains a total price 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.