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

  • Home
  • SEARCH
  • 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 9161233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:55:22+00:00 2026-06-17T13:55:22+00:00

I’m trying to query the data of the second table within my database. I

  • 0

I’m trying to query the data of the second table within my database.

I am able to insert into the database (or am led to believe it is successful)

I have altered the version numbers, but this still seems to have effect at all.

Can anyone see what I have done wrong here?

Currently I’m getting the following error:

Logcat:

01-20 20:32:15.076: E/AndroidRuntime(303): FATAL EXCEPTION: main
01-20 20:32:15.076: E/AndroidRuntime(303): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.flybase2/com.example.flybase2.ViewAppointments}: android.database.sqlite.SQLiteException: no such table: appointmentTable: , while compiling: SELECT _id, app_name, app_type, app_time, app_date, app_comments FROM appointmentTable ORDER BY app_name ASC
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.os.Looper.loop(Looper.java:123)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread.main(ActivityThread.java:4627)
01-20 20:32:15.076: E/AndroidRuntime(303):  at java.lang.reflect.Method.invokeNative(Native Method)
01-20 20:32:15.076: E/AndroidRuntime(303):  at java.lang.reflect.Method.invoke(Method.java:521)
01-20 20:32:15.076: E/AndroidRuntime(303):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-20 20:32:15.076: E/AndroidRuntime(303):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-20 20:32:15.076: E/AndroidRuntime(303):  at dalvik.system.NativeStart.main(Native Method)
01-20 20:32:15.076: E/AndroidRuntime(303): Caused by: android.database.sqlite.SQLiteException: no such table: appointmentTable: , while compiling: SELECT _id, app_name, app_type, app_time, app_date, app_comments FROM appointmentTable ORDER BY app_name ASC
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:46)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1301)
01-20 20:32:15.076: E/AndroidRuntime(303):  at com.example.flybase2.DBHandler.getAppointmentsData(DBHandler.java:325)
01-20 20:32:15.076: E/AndroidRuntime(303):  at com.example.flybase2.ViewAppointments.onCreate(ViewAppointments.java:34)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-20 20:32:15.076: E/AndroidRuntime(303):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

Column variables:

    public static final String KEY_ROWAPPID = "_appid";
public static final String KEY_NAMEAPP = "app_name";
public static final String KEY_TYPEAPP = "app_type";
public static final String KEY_TIMEAPP = "app_time";
public static final String KEY_DATEAPP = "app_date";
public static final String KEY_COMMENTAPP = "app_comments";
public static final String KEY_ALARM = "app_alarm";

Table name and version:

private static String DATABASE_TABLEAPP = "appointmentTable";
private static int DATABASE_VERSIONAPP = 1;

Heres my on create method:

    @Override
    public void onCreate(SQLiteDatabase db) {


        db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_NAME + " TEXT NOT NULL, " +
                KEY_TEL + " TEXT NOT NULL, " +
                KEY_EMAIL + " TEXT NOT NULL, " +
                KEY_COMMENTS + " TEXT NOT NULL);"

                );

        db.execSQL("CREATE TABLE " + DATABASE_TABLEAPP + " (" +
                KEY_ROWAPPID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_NAMEAPP + " TEXT NOT NULL, " +
                KEY_TYPEAPP + " TEXT NOT NULL, " +
                KEY_TIMEAPP + " TEXT NOT NULL, " +
                KEY_DATEAPP + " TEXT NOT NULL, " +
                KEY_COMMENTAPP + " TEXT NOT NULL, " +
                KEY_ALARM + " BOOLEAN NOT NULL);"

                );

On upgrade:

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

        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
        onCreate(db);

        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLEAPP);
        onCreate(db);
    }

Method used for querying the table:

    public Cursor getAppointmentsData() {
        String [] columns = new String[]{KEY_ROWAPPID, KEY_NAMEAPP, KEY_TYPEAPP, KEY_TIMEAPP, KEY_DATEAPP, KEY_COMMENTAPP};
        Cursor c = ourDatabase.query(DATABASE_TABLEAPP, columns, null, null, null, null, KEY_NAMEAPP + " ASC", null);
        return c;   
  • 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-17T13:55:23+00:00Added an answer on June 17, 2026 at 1:55 pm

    Drop the first onCreate( db ) call.

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    
        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLEAPP);
        onCreate(db);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.