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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:07:48+00:00 2026-06-05T08:07:48+00:00

I have the following code which collects data (same class) from fields in the

  • 0

I have the following code which collects data (same class) from fields in the layout and tries to put it inside a msqlite database :

public void submitOrder(Order order_) {
    SQLiteDatabase db=DBHelper.getWritableDatabase();
    ContentValues cv=new ContentValues();
        cv.put(DatabaseHelper.colName,      order_.name);
        cv.put(DatabaseHelper.colLink,      order_.link);
        cv.put(DatabaseHelper.colPrice,     order_.price);
        cv.put(DatabaseHelper.colDateYear,  order_.year);
        cv.put(DatabaseHelper.colDateMonth, order_.month);
        cv.put(DatabaseHelper.colDateDay,   order_.day);

        db.insert(DatabaseHelper.orderTable, null, cv);
    db.close();

And i have the MSQlite database helper Class i’ve created :

package com.Sagi.MyOrders;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {

static final String dbName="DBname";
static final String orderTable="Orders";
static final String colName="OrderName";
static final String colLink="OrderLink";
static final String colDateYear="DateYear";
static final String colDateMonth="DateMonth";
static final String colDateDay="DateDay";
static final String colPrice="OrderPrice";
static String CREATE_T;

public DatabaseHelper(Context context) {
      super(context, dbName, null,1);
}
/** Called when the activity is first created. */
@Override
public void onCreate(SQLiteDatabase db) {
        CREATE_T="CREATE TABLE orderTable ("
                + "colName TEXT,"
                + "colLink TEXT,"
                + "colPrice TEXT,"
                + "colDateYear INTEGER,"
                + "colDateMonth INTEGER,"
                + "colDateDay INTEGER);";
        db.execSQL(CREATE_T);
        Log.e("Table creator","Table Created successfully");
     }

When i run it and click on the button to store the info in the DB, i get an error message :

06-02 06:19:43.454: E/Database(1570): android.database.sqlite.SQLiteException: table Orders has no column named OrderPrice: , while compiling: INSERT INTO Orders(DateDay, DateMonth, OrderLink, OrderName, OrderPrice, DateYear) VALUES(?, ?, ?, ?, ?, ?);

And an I level message :

06-02 06:19:43.444: I/Database(1570): sqlite returned: error code = 1, msg = table Orders has no column named OrderPrice

Hope you can help … thanks !

  • 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-05T08:07:49+00:00Added an answer on June 5, 2026 at 8:07 am

    It says table Orders has no column named OrderPrice. The reason is you don’t update your database. Simply Uninstall/ReInstall your app. And everything will be ok.

    After your edit:

    You create your table with

    CREATE_T="CREATE TABLE orderTable ("
                    + "colName TEXT,"
                    + "colLink TEXT,"
                    + "colPrice TEXT,"
                    + "colDateYear INTEGER,"
                    + "colDateMonth INTEGER,"
                    + "colDateDay INTEGER);";
            db.execSQL(CREATE_T);
    

    Which means you create a table called orderTable.

    But in your insert:

    public void submitOrder(Order order_) {
        SQLiteDatabase db=DBHelper.getWritableDatabase();
        ContentValues cv=new ContentValues();
            cv.put(DatabaseHelper.colName,      order_.name);
            cv.put(DatabaseHelper.colLink,      order_.link);
            cv.put(DatabaseHelper.colPrice,     order_.price);
            cv.put(DatabaseHelper.colDateYear,  order_.year);
            cv.put(DatabaseHelper.colDateMonth, order_.month);
            cv.put(DatabaseHelper.colDateDay,   order_.day);
    
            db.insert(DatabaseHelper.orderTable, null, cv); // This line
        db.close();
    

    You use DatabaseHelper.orderTable which is static final String orderTable="Orders";
    They are not equal so you are getting this error.

    Change your orderTable variable or the table name, then you will be ok

    Hope this helps

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

Sidebar

Related Questions

I have following code which on save from the admin area creates a duplicate
I have following code which works for radio buttons but need to be changed
I want to know is below code correct ? I have following code which
i have the following code which works fine to download image form url .
I have the following code which is meant to access the local database and
I have the following code which works: $(document).ready(function() { var xhr = false; func_two();
i have the following code which works perfect. Objective: Given a number n, find
I have the following code which draws an attributed string in a rect: CGContextRef
I have the following code which is supposed to send a notification on ajax
I have the following code which splits a string of numbers (separated by a

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.