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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:05:37+00:00 2026-06-10T07:05:37+00:00

I am trying to insert a record in a database but I am getting

  • 0

I am trying to insert a record in a database but I am getting error. What’s the problem I am not getting. I tried the same code by removing IMAGEPATH column but still it gives same error for DESCRIPTION.

DataBaseHelper:

public class GREDatabaseHelper extends SQLiteOpenHelper {

private static final String DATABASE_NAME = "gre_db.db";
private static final int DATABASE_VERSION = 1;

public static final String TABLE_NAME_ENGLISH = "english_table";
public static final String COLUMN_NAME_WORD = "word_column";
public static final String COLUMN_NAME_SYNONYM = "synonym_column";
public static final String COLUMN_NAME_DESCRIPTION = "descrption_column";
public static final String COLUMN_NAME_IMAGEPATH = "image_column";

GREDatabaseHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {

    String sqlQueryToCreateEnglishTable = "CREATE TABLE IF NOT EXISTS "
            + TABLE_NAME_ENGLISH + " (" + COLUMN_NAME_WORD
            + "TEXT PRIMARY KEY, " + COLUMN_NAME_SYNONYM + "TEXT, "
            + COLUMN_NAME_DESCRIPTION + "TEXT, " + COLUMN_NAME_IMAGEPATH
            + "TEXT " + ");";
    db.execSQL(sqlQueryToCreateEnglishTable);

    Log.d("Table_Created", "english_table");
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

}

@Override
public void onOpen(SQLiteDatabase db) {
    super.onOpen(db);
}

void addWord(EngFieldsClass obj) {
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues cv = new ContentValues();
    cv.put(COLUMN_NAME_WORD, obj.getengWord());
    cv.put(COLUMN_NAME_SYNONYM, obj.getengSynonyms());
    cv.put(COLUMN_NAME_DESCRIPTION, obj.getengDescription());
    cv.put(COLUMN_NAME_IMAGEPATH, obj.getengImage());
    // INSERT ROWS
    db.insertOrThrow(TABLE_NAME_ENGLISH, null, cv);
    db.close();
}

}

InsertRecord Query:

                   String word=editTextWord.getText().toString();
        String synonym= editText Synonym.getText().toString();
        String description= editText Description.getText().toString();
        String imgpath=textViewImagePath.getText().toString();

        final GREDatabaseHelper db= new GREDatabaseHelper(this);
        db.addWord(new EngFieldsClass(word,synonym,description,imgpath));

Error:

08-26 19:03:36.230: D/Table_Created(1350): english_table
08-26 19:03:36.239: I/Database(1350): sqlite returned: error code = 1, msg = table english_table has no column named image_column
08-26 19:03:36.249: D/AndroidRuntime(1350): Shutting down VM
08-26 19:03:36.259: W/dalvikvm(1350): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-26 19:03:36.269: E/AndroidRuntime(1350): FATAL EXCEPTION: main
08-26 19:03:36.269: E/AndroidRuntime(1350): android.database.sqlite.SQLiteException: table english_table has no column named image_column: , while compiling: INSERT INTO english_table(image_column, descrption_column, synonym_column, word_column) VALUES(?, ?, ?, ?);
  • 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-10T07:05:38+00:00Added an answer on June 10, 2026 at 7:05 am
    String sqlQueryToCreateEnglishTable = "CREATE TABLE IF NOT EXISTS "
                + TABLE_NAME_ENGLISH + " (" + COLUMN_NAME_WORD
                + " TEXT PRIMARY KEY, " + COLUMN_NAME_SYNONYM + " TEXT, "
                + COLUMN_NAME_DESCRIPTION + " TEXT, " + COLUMN_NAME_IMAGEPATH
                + " TEXT " + ");";
    

    Use this as your create table query. Note that you need to have space before TEXT like ” TEXT”. This will make it a column of type TEXT. Else the column will be image_columnTEXT

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

Sidebar

Related Questions

I'm trying to insert a record into the database but it is giving me
I have a problem when trying to insert a new record into a database.
I am trying to insert a record into my database. here is my php
I'm trying to insert a record (on LINQ to SQL) to the database. So
I'am trying to insert record into db2 table and getting a result with response.write.
I am trying to insert a record into a table using Linq but get
i'm trying to insert user details, who authorize the app, into the database, but
I have trying to insert a record into the database (MySQL), using Entity Class
I'm getting this error when I'm trying to update a record: ERROR [HY000] [Microsoft][ODBC
I'm using a mysql database, and I'm trying to insert a record into tableB

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.