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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:53:47+00:00 2026-05-20T13:53:47+00:00

So, the issue is simple. I am updating into a table, and the primary

  • 0

So, the issue is simple. I am updating into a table, and the primary key is autoincrementing… This means that all related tables are screwed over. I am using sqlite, so I don’t think there is any inherent mechanism that can catch this and related tables.

Due to a lack of support for foreign keys in the sqlite versions I must work with, I force the relations by adding the primary key returned from an insert into the parent table into the related tables when entering new data.

Is there an alternative to updating all related tables each time I do an update? Please say yes..

Edit: last edit was wrong, I got confused. I have simply pasted the code governing inserts/replacements below. I am replacing into, not updating into, typing error on my part.

//inserts
public long insertIntoCompany(String company, int subs) {
    ContentValues cv = new ContentValues();

    cv.put(company_column, company);
    cv.put(company_subscribed_column, subs);

    return db.replace(company_table, null, cv);
}
  • 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-20T13:53:48+00:00Added an answer on May 20, 2026 at 1:53 pm

    You should actually be using the SQL update query. See this answer.

    If you paste your query we might be able to offer more help.

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

Sidebar

Related Questions

I've been running into a presentation issue with Internet Explorer. The following simple block
The issue that prompted me to ask this is a web form that was
See: Placement new issue Simple question, would this solve the align problem? union {
This simple issue I know, in my program session variable is already working properly
This is a very simple issue. I'm trying to put a link to an
I'm working on updating an old site and I ran into the following simple,
my table has two column columnname and data i issue a simple sql like
That simple. Moving my layout into a fluid territory, working on scalable images. Using
The issue is simple really. Instead of creating folders in Visual Studio, I create
I have big issue with url-rewriting for IIS 7.0. I've written simple module for

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.