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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:36:20+00:00 2026-05-24T08:36:20+00:00

I have a common problem, and have looked at several solutions but haven’t seen

  • 0

I have a common problem, and have looked at several solutions but haven’t seen one that fits this case.

I have a temporary table that is defined as follows:

public static final String GROUP_TABLE_CREATE =
         "CREATE TEMP TABLE "+GROUP_TABLE_NAME+" ("
         +GROUP_ID_COLUMN_NAME+" INTEGER PRIMARY KEY AUTOINCREMENT, "
         +GROUP_GROUP_ID_COLUMN_NAME+" INTEGER NOT NULL UNIQUE, "
         +GROUP_COLUMN_NAME+" VARCHAR(64) NOT NULL)";

The table is created without any problems. I then download some data to insert into it and use the following query to insert it:

ContentValues contentValues = new ContentValues();
contentValues.put(WhereWolfOpenHelper.GROUP_GROUP_ID_COLUMN_NAME, groupID);
contentValues.put(WhereWolfOpenHelper.GROUP_COLUMN_NAME, groupName);
db.insert(WhereWolfOpenHelper.GROUP_TABLE_NAME, null, contentValues);

And then I get the following error:

08-05 08:52:37.791: ERROR/Database(847): Error inserting group_name=Friends group_id=2
08-05 08:52:37.791: ERROR/Database(847): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed

The error appears twice, and the only data in the database is the group named Friends (there should be two more entries).

I have another table with very similar code that works without any problems, so I’m guessing it’s just some silly mistake that I haven’t spotted. Anyone got any ideas?

  • 1 1 Answer
  • 2 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-24T08:36:21+00:00Added an answer on May 24, 2026 at 8:36 am

    If “constraint failed” than something in table scheme should tell us what is wrong.
    I see what it show data what it want to insert, this means what NOT NULL constraint is OK.
    In this case I’ve only one assumption what you already inserted some GROUP_GROUP_ID_COLUMN_NAME with value 2 and UNIQUE constraint is failed because of that.

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

Sidebar

Related Questions

This seems to be a fairly common problem, but the solutions that I have
I have a common problem that I never know how to solve with CSS:
This is a fairly common problem to which I have yet to find an
This must be a common problem with a common solution. I have a lot
This is a slightly original variation on a common problem. I have a fairly
A common problem that I have with web pages is floating div tags creeping
I feel like this is a pretty common problem but I wasn't really sure
I have common functionality that I need to access from all screens of my
I have this common issue of 'new line' in php-csv which is making me
I have a common comms library that i have written to communicate with our

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.