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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:06:39+00:00 2026-05-25T13:06:39+00:00

My code is ContentValues values; values = new ContentValues(); values.put(SQLHelper.EMPLOYEE_LPN, jsObj.getString(lpn)); db.update(SQLHelper.EMPLOYEE_TABLE, values, EMPLOYEE_LPN

  • 0

My code is

ContentValues values; 
values = new ContentValues();
        values.put(SQLHelper.EMPLOYEE_LPN, jsObj.getString("lpn"));
db.update(SQLHelper.EMPLOYEE_TABLE, values,
                "EMPLOYEE_LPN ='" + jsObj.getString("lpn") + "'",
                null);

a warning is shown in the Log Cat

08-31 15:19:45.297: WARN/Database(2868): Reached MAX size for compiled-sql statement cache for database /data/data/org.sipdroid.sipua/databases/test.db; i.e., 
NO space for this sql statement in cache: 
SELECT EMPLOYEE_NAME FROM eyemployee WHERE EMPLOYEE_LPN ='1169162'. 
Please change your sql statements to use '?' for bindargs, instead of using actual values

How to resolve it?

  • 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-25T13:06:40+00:00Added an answer on May 25, 2026 at 1:06 pm

    Look at examples 8-3 and 8-4 here.

    Example 8-3. Using the update method

    /**
     * Update a job in the database.
     * @param job_id         The job id of the existing job
     * @param employer_id    The employer offering the job
     * @param title          The job title
     * @param description    The job description
     */
    public void editJob(long job_id, long employer_id, String title, String description) {
        ContentValues map = new ContentValues();
        map.put("employer_id", employer_id);
        map.put("title", title);
        map.put("description", description);
        String[] whereArgs = new String[]{Long.toString(job_id)};
        try{
            getWritableDatabase().update("jobs", map, "_id=?", whereArgs);
        } catch (SQLException e) {
            Log.e("Error writing new job", e.toString());
        }
    }
    

    Here are some of the highlights of the code in Example 8-3:

    Example 8-4 shows you how to use the execSQL method.
    Example 8-4. Using the execSQL method

    /**
     * Update a job in the database.
     * @param job_id         The job id of the existing job
     * @param employer_id    The employer offering the job
     * @param title          The job title
     * @param description    The job description
     */
    public void editJob(long job_id, long employer_id, String title, String description) {
        String sql = 
            "UPDATE jobs " +
            "SET employer_id = ?, "+
            " title = ?,  "+
            " description = ? "+
            "WHERE _id = ? ";
        Object[] bindArgs = new Object[]{employer_id, title, description, job_id};
        try{
            getWritableDatabase().execSQL(sql, bindArgs);
        } catch (SQLException e) {
            Log.e("Error writing new job", e.toString());
        }
    }
    

    The message is asking you to make parameters use sql variables instead of sql literals.

    Each sql query is parsed, plans are generated, and stored in a sql statement cache.

    Queries which have the same text are fetched from the cache.

      --One query
    SELECT * FROM Customers WHERE Id = @1   (@1 = 3)
    SELECT * FROM Customers WHERE Id = @1   (@1 = 4)
    SELECT * FROM Customers WHERE Id = @1   (@1 = 5)
    

    Queries which have different text (including literals) cannot be found in the cache and are (uselessly) added to it.

      --Three Queries.
    SELECT * FROM Customers WHERE Id = 3
    SELECT * FROM Customers WHERE Id = 4
    SELECT * FROM Customers WHERE Id = 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update/change contact ringtone using this code: ContentValues values = new ContentValues();
I am trying to insert a new call on my HTC programmatically. ContentValues values
I have this code : private void insertValus() { ContentValues initialValues = new ContentValues();
I'm attaching a PNG image to an e-mail with the following code: ContentValues values
I am new to Android following is my code I wants to add data
I using below code to insert new sms in inbox, but when i click
I want to update/insert a new image for an album in MediaStore but i
i'm a new android developper and i'm getting a null pointer exception when i
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
Code: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Unusual Array Lengths!</title> <script type=text/javascript> var arrayList = new Array();

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.