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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:55:07+00:00 2026-06-01T09:55:07+00:00

package nidhin.survey; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper;

  • 0
package nidhin.survey;

import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {

static final String TABLE = "mygrades";
static final String NAME = "name";
static final String VALUE1 = "value1";
static final String VALUE2 = "value2";
static final String VALUE3 = "value3";
static final String VALUE4 = "value4";
static final String VALUE5 = "value5";
static final String VALUE6 = "value6";
static final String VALUE7 = "value7";
static final String VALUE8 = "value8";
static final String VALUE9 = "value9";
static final String VALUE10 = "value10";
static final String VALUE11 = "value11";


DatabaseHelper(Context context)
{
    super(context, "grades.sqlite", null, 1);
}

@Override
public void onCreate(SQLiteDatabase db) 
{

    db.execSQL("CREATE TABLE " + TABLE + " (_id INTEGER PRIMARY KEY AUTOINCREMENT," + 
            VALUE1 + " TEXT, " + VALUE2 + " TEXT, " +VALUE3 + " TEXT, " + VALUE4 + " TEXT, " +VALUE5 + " TEXT, " +VALUE6 + " TEXT, " +VALUE7 + " TEXT, " +VALUE8 + " TEXT, " +VALUE9 + " TEXT, " +VALUE10 + " TEXT, " +
            VALUE11 + " REAL);");

    ContentValues cv = new ContentValues();

}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
{
    // TODO Auto-generated method stub
    android.util.Log.w("mygrades", "Upgrading database, this will destroy all data");
    db.execSQL("DROP TABLE IF EXISTS " + TABLE);
    onCreate(db);
}

}

I have a problem (which is likely to be a syntax issue). I am trying to create a table in android with the help of SQLite. I have a NAME column and VALUE1 through VALUE11 columns. However when I try to run the code, I get the following error in Logcat:

03-30 02:38:16.593: E/AndroidRuntime(693): java.lang.RuntimeException: Unable to start activity ComponentInfo{nidhin.survey/nidhin.survey.Database}: android.database.sqlite.SQLiteException: no such column: value1: , while compiling: SELECT _id, name, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, value11 FROM mygrades

Any ideas ?

  • 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-01T09:55:09+00:00Added an answer on June 1, 2026 at 9:55 am

    Have you modified your table schema since the first time you ran your app?

    If you did, that is most likely your issue.

    Looking at the code you gave, you still have the DB version set at 1, so the table has not been re-created with your new column additions (one of which I would bet would be “value1”).

    Change super(context, "grades.sqlite", null, 1); to super(context, "grades.sqlite", null, 2);, run your app again and I bet it will work out.

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

Sidebar

Related Questions

package nidhin.survey; import android.app.Activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.*;
package com.Kiro.Test; import android.app.Activity; import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People;
package com.example.android.home; import android.app.Activity; import android.os.Bundle; import android.widget.*; import android.view.*; public class HomeActivity extends
package com.parseador.prueba; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.EditText; public class main extends
package database; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import database.Dbconnect; public class
package com.example.helloandroid; import java.io.File; import android.os.AsyncTask; import android.os.Environment; import android.widget.Toast; public class CheckTask extends
package com.comboyz.TantaGo; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; public class startMenu extends ListActivity{ @Override
package my.pack; import java.util.Iterator; import android.app.Activity; import android.content.Context; import android.location.GpsSatellite; import android.location.GpsStatus; import android.location.GpsStatus.NmeaListener;
package employee; import employee.nidhin.staples; import java.util.*; import java.io.*; public class Employee { public static
package com.phonegap; import org.apache.cordova.*; import android.os.Bundle; public class PhoneGapSampleActivity extends DroidGap { /** Called

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.