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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:22:58+00:00 2026-06-12T01:22:58+00:00

To update a value in my SQLite database (android) I use following method. The

  • 0

To update a value in my SQLite database (android) I use following method. The table is calles objects, the field I want to update is showinfo1, of a specific item with a certain id and level.

public void insertString(int id, int level, String field, String value){

        myDataBase.execSQL("UPDATE OBJECTS SET " + field + "=" + value + " WHERE _ID=" + id + " AND LEVEL =" + level);

    }

I have an error which I think is strange. It says there is ‘nosuchcolumn’ while there actually is one..:

android.database.sqlite.SQLiteException: no such column: true: UPDATE OBJECTS set showinfo1=true WHERE _ID=6 AND LEVEL =1

Any ideas how to solve this? Maybe my query is wrong?

  • 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-06-12T01:22:59+00:00Added an answer on June 12, 2026 at 1:22 am

    your query should be like this

    public void insertString(int id, int level, String field, String value){
    
        myDataBase.execSQL("UPDATE OBJECTS SET " + field + "='" + value + "' WHERE _ID=" + id + " AND LEVEL =" + level);
    
    }
    

    your string is translating to UPDATE OBJECTS SET URFIELD = true ... and it is searching for the column named true, so it should be URFIELD = 'true' (same goes for ID and LEVEL if they were text)

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

Sidebar

Related Questions

When attempting to update value, these error are occuring, 02-09 11:37:53.573: ERROR/AndroidRuntime(4809): android.database.sqlite.SQLiteException: attempt
I am trying to update a value in my sqlite Android database. I am
I have created a database using SQLite. I want to update the value of
i want to update multiple value of my table ORDRE ? table ORDRE CP
I want to always update the value of an update row in the database.
I have one table TABLE_EXAM . i need to update the value of specific
I am trying a database app on Android. I want to use the SQLiteDatabase
Hey what i want to do is update a table if the field exsits
I have an sqlite database on android created like this: sqlite> .schema CREATE TABLE
I am trying to update a single column in a SQLite database table in

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.