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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:07:42+00:00 2026-05-20T05:07:42+00:00

I have checked everything and the creating of the database is fine its when

  • 0

I have checked everything and the creating of the database is fine its when I try to add data to it that it forces the app to close. I cant see why.

    db.execSQL("CREATE TABLE IF NOT EXISTS " +
            SAMPLE_TABLE_NAME2    
            + " (GenID INT, "
            + " Nxtq INT);");

    db.execSQL("INSERT INTO " +
            SAMPLE_TABLE_NAME2 +
            " Values (1,1);");

The error I get output is

Failure 1 (table general has 4 columns but 2 values were supplied) when prepearing ‘INSERT INTO general values (1,1)

There is some stuff before these two query’s here it is in its entirety.

    db =  this.openOrCreateDatabase(SAMPLE_DB_NAME, MODE_PRIVATE, null);

    db.execSQL("CREATE TABLE IF NOT EXISTS " +
            SAMPLE_TABLE_NAME +
            " (ID INT(3), Questions VARCHAR, Answer1 VARCHAR," +
            " Answer2 VARCHAR, Answer3 VARCHAR," +
            " Answer4 VARCHAR, CorrectAnswer INT(1), Reason VARCHAR);");

    db.execSQL("CREATE TABLE IF NOT EXISTS " +
            SAMPLE_TABLE_NAME2    
            + " (GenID INT, "
            + " Nxtq INT);");

    db.execSQL("INSERT INTO " +
            SAMPLE_TABLE_NAME2 +
            " Values (1,1);");
  • 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-20T05:07:42+00:00Added an answer on May 20, 2026 at 5:07 am

    try changing the name of “general” to something else like “general_new” and see if the script works, as mentioned, general the table might already exist (even if you don’t think you made it yourself).

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

Sidebar

Related Questions

it happens when i change the DataSource. i have checked everything(stack traces, all exception
I have checked few other posts and found some UIAnimation transitions that kind-of give
I have checked out now a local working copy of a codebase that lives
I have a problem creating a for-loop using Javascript. It seems everyting is fine
I have problem with creating constructor, which Jenkins can call for some JSON data
I have checked as many SO pages as I could and tried everything I
I have a few Devexpress aspx controls on a website that look fine on
I have checked in FireFox Firebug and found that Keypress event is not attached
I have a Chrome Extension in English and everything works fine. Looking in to
I have the YAML for the invoice data to go into the testing database:

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.