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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:43:08+00:00 2026-06-01T02:43:08+00:00

My db in my app worked fine, then I added odometer to the db.

  • 0

My db in my app worked fine, then I added odometer to the db. Now I am getting a table inspections has no column named odometer: , while compiling: INSERT INTO inspections(codriver, odometer, driver, datetime, vehicle_id, status, vehicle_type) VALUES(?, ?, ?, ?, ?, ?, ?); error in logcat. I checked my db adapter and the code is working properly, but for some reason it is not recognizing the new column I added.
Here is the code from the db

@Override
public void onCreate(SQLiteDatabase db)
{
    String DATABASE_CREATE = "create table inspections ("
            + "_id integer  primary key autoincrement, "
            + "vehicle_id   string  not null, "
            + "vehicle_type string  not null, "
            + "datetime     integer not null, "
            + "driver       string  not null, "
            + "codriver     string  , "
            + "status       integer not null, "
            + "odometer     string  not null "
            + ");";
    db.execSQL(DATABASE_CREATE);

}

here is the code for the main db

public class SignalSetDBHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "db";
private static final int DATABASE_VERSION = 1;

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

// Method is called during creation of the database
@Override
public void onCreate(SQLiteDatabase db) {
    CurrentStateTable.onCreate(db);
    HoursOfServiceTable.onCreate(db);
    InspectionsTable.onCreate(db);
    }

// Method is called during an upgrade of the database,
// e.g. if you increase the database version
@Override
public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
    CurrentStateTable.onUpgrade(database, oldVersion, newVersion);
    HoursOfServiceTable.onUpgrade(database, oldVersion, newVersion);
    InspectionsTable.onUpgrade(database, oldVersion, newVersion);
}
}

I can include more code, but pretty sure the error is in the code above

update:
uninstalled the app on the emulator, still getting the same error. Here is the logcat
03-28 12:52:59.135: D/dalvikvm(331): GC_EXTERNAL_ALLOC freed 885 objects / 63248 bytes in 78ms
03-28 12:53:05.695: D/dalvikvm(331): GC_FOR_MALLOC freed 4480 objects / 261760 bytes in 73ms
03-28 12:53:17.065: W/KeyCharacterMap(331): No keyboard for id 0
03-28 12:53:17.065: W/KeyCharacterMap(331): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-28 12:53:28.615: I/Database(331): sqlite returned: error code = 1, msg = table inspections has no column named odometer
03-28 12:53:28.715: D/dalvikvm(331): GC_FOR_MALLOC freed 8584 objects / 420616 bytes in 84ms
03-28 12:53:28.715: E/Database(331): Error inserting codriver= odometer=4321 driver=jim datetime=1332964380 vehicle_id=ET 432 status=1 vehicle_type=truck
03-28 12:53:28.715: E/Database(331): android.database.sqlite.SQLiteException: table inspections has no column named odometer: , while compiling: INSERT INTO inspections(codriver, odometer, driver, datetime, vehicle_id, status, vehicle_type) VALUES(?, ?, ?, ?, ?, ?, ?);
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:36)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1536)
03-28 12:53:28.715: E/Database(331): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)
03-28 12:53:28.715: E/Database(331): at com.signalsetapp.database.InspectionDBAdapter.insertInspection(InspectionDBAdapter.java:54)
03-28 12:53:28.715: E/Database(331): at com.signalsetapp.report.save(report.java:120)
03-28 12:53:28.715: E/Database(331): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 12:53:28.715: E/Database(331): at java.lang.reflect.Method.invoke(Method.java:521)
03-28 12:53:28.715: E/Database(331): at android.view.View$1.onClick(View.java:2067)
03-28 12:53:28.715: E/Database(331): at android.view.View.performClick(View.java:2408)
03-28 12:53:28.715: E/Database(331): at android.view.View$PerformClick.run(View.java:8816)
03-28 12:53:28.715: E/Database(331): at android.os.Handler.handleCallback(Handler.java:587)
03-28 12:53:28.715: E/Database(331): at android.os.Handler.dispatchMessage(Handler.java:92)
03-28 12:53:28.715: E/Database(331): at android.os.Looper.loop(Looper.java:123)
03-28 12:53:28.715: E/Database(331): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-28 12:53:28.715: E/Database(331): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 12:53:28.715: E/Database(331): at java.lang.reflect.Method.invoke(Method.java:521)
03-28 12:53:28.715: E/Database(331): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-28 12:53:28.715: E/Database(331): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-28 12:53:28.715: E/Database(331): at dalvik.system.NativeStart.main(Native Method)

  • 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-01T02:43:10+00:00Added an answer on June 1, 2026 at 2:43 am

    SQLiteOpenHelper is seeing your existing database and so it isn’t calling onCreate.

    You need to uninstall your app so that you get rid of the existing database.

    If you’re in dev mode, you can just change the DATABASE_NAME to db2 as a quick hack to get yourself going, but remember to change it back later once your database is stable.

    If you want to do it in the most proper way, you can increment DATABASE_VERSION, then implement some ALTER TABLE statements in onUpgrade.

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

Sidebar

Related Questions

I have developed an app that in testing has worked fine but when it
I'm not sure what is happening with this app. It worked fine then one
I am developing an app on facebook. Since yesterday the resizing worked fine with
I have been working on an app in XCode for a while now and
I developed a site with CakePHP version 1.2.5 and everything worked fine by then.
My application shows an AlertDialog with a ListView inside. Everything worked fine bun then
So, I had a phonegap app that worked fine on iOS 5, but when
This is weird. I created a Facebook iFrame App that worked fine in every
I'm sure my app worked right until yesterday, when I got this error: Failed
I am working on a load generator app using akka actors. The app worked

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.