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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:45:46+00:00 2026-06-02T17:45:46+00:00

I have a strange problem to update a table in my database…forgive me if

  • 0

I have a strange problem to update a table in my database…forgive me if I can not explain well but I’m a bit confused…
The problem is this:
I created a table with values, I read this values in my listview..everything works for now..insert and delete values works without problem..now created a loop in a service why do I need to make a comparison between a value and a string of my database and when this comparison is true, I need to change a value in my table..

The real problem is this: my db.update works only if not use … never, the command db.delete… if use it, the db.update not work anymore ..and to make it work again, i need to make a new AVD.

how is it possible?
my db.delete and id is this:

item.getMenuInfo();
    id = getListAdapter().getItemId(info.position);

public void deleteReg(SQLiteDatabase db ,long id) 
        {
           db.delete(TabRegistry.TABLE_NAME, TabRegistry._ID + "=" + id, null);
        }

on activity:

 databaseHelper.deleteReg(db, id);

my db.update is this: (positions is a value of getPositions(),for locate a positions with a cursor(always works, even when fails db.update))

public void updateReg(SQLiteDatabase db,int positions, String stat)
    {
        ContentValues v = new ContentValues();
        v.put(TabRegistry.STATUS, stat);
        db.update(TabRegistry.TABLE_NAME, v, TabRegistry._ID + " = " + positions, null);
    }

on service:

   databaseHelper.updateReg(db, positions, "SUCCESS");

if you need more code, tell me what I add now..thanks in advance

  • 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-02T17:45:47+00:00Added an answer on June 2, 2026 at 5:45 pm

    The SQLite api you are using is based off of CRUD operations (you should read this).

    You are DELETE-ing the record from the database, therefore there is nothing to UPDATE when you attempt to update it. If you want to create a new record, or recreate the one you deleted then you would perform an INSERT instead of an UPDATE.

    EDIT:

    It also appears you are passing in position number to the update and delete. I assume that you are also using this value to place the record in your table? Is it possible that when you delete the record from the table and the database, that the other records now have an invalid position because they haven’t been updated also? It’s just a shot in the dark, figured I might as well ask.

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

Sidebar

Related Questions

I have created database table. But there is a strange thing I can insert
I have a strange problem that I could not solve. When I try to
I have a strange problem. Could someone explain me why : If I have
I have a strange problem which I can't fix: A field: private boolean[][][] gaps;
I have a strange problem with my webapplication, it works on local host but
I'm experiencing something a bit strange. I have a table on SQL Server 2008,
got strange error Correlation name 'Club' not found but the table Club is in
I have a strange problem. I convert a date using the following CONVERT(varchar(64), table.[Date],
I have some sort of a strange problem, I have an update panel which
I have a strange problem. I am trying to update some fields using linq

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.