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

The Archive Base Latest Questions

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

Okay, here’s the situation: I’ve created a class extending Android’s SQLOpenHelper class. I’ve also

  • 0

Okay, here’s the situation: I’ve created a class extending Android’s SQLOpenHelper class. I’ve also implemented the required methods, onCreate and onUpgrade, to initialize tables and to drop the current tables and then re-create new ones respectively.

The tables were successfully created but when I tried to call a method to insert a new record to the database LogCat gave me this instead:

06-17 21:31:19.907: I/SqliteDatabaseCpp(561): sqlite returned: error code = 1, msg = table calendarEvents has no column named colour, db=/data/data/stub.binusitdirectorate.calendar/databases/calendarSQLite

I’ve done some search regarding this problem. Most of the answers suggested to re-install the app and repeat the process. Done, but still no success.

Here’s my SQLiteOpenHelper onCreate method:

    public void onCreate(SQLiteDatabase db) {
            String CREATE_EVENTS_TABLE = "CREATE TABLE " + EVENTS_TABLE + "("
                    + KEY_EVENTS_TYPE_ID + " TEXT PRIMARY KEY,"
                    + KEY_EVENTS_TYPE_NAME + " TEXT," + KEY_EVENTS_NAME + " TEXT,"
                    + KEY_EVENTS_COLOR + "TEXT," + KEY_EVENTS_START_DATE + "DATE,"
                    + KEY_EVENTS_END_DATE + "TEXT" + ")"
    
            db.execSQL(CREATE_EVENTS_TABLE);
        }

And here’s my method for inserting new records:

    public void addEventsList(ArrayList<CalendarEventData> lstCalendarEvents) {
        SQLiteDatabase db = this.getWritableDatabase();

        if (lstCalendarEvents != null && db != null) {
            for (int i = 0; i < lstCalendarEvents.size(); i++) {
                ContentValues values = new ContentValues();

                values.put(KEY_EVENTS_TYPE_ID, lstCalendarEvents.get(i)
                        .getEventTypeId());
                values.put(KEY_EVENTS_TYPE_NAME, lstCalendarEvents.get(i)
                        .getEventTypeName());
                values.put(KEY_EVENTS_NAME, lstCalendarEvents.get(i)
                        .getEventName());
                values.put(KEY_EVENTS_COLOR, lstCalendarEvents.get(i)
                        .getColour());
                values.put(KEY_EVENTS_START_DATE, DateUtils
                        .getFormattedDateString(lstCalendarEvents.get(i)
                                .getStartDateTime(), dateFormat));
                values.put(KEY_EVENTS_END_DATE, DateUtils
                        .getFormattedDateString(lstCalendarEvents.get(i)
                                .getEndDateTime(), dateFormat));

                db.insert(EVENTS_TABLE, null, values);
             }

            db.close();
         }

    }

I’m fairly new to Android and was using this tutorial as a guide.

Thanks in advance! 🙂

  • 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-05T22:48:53+00:00Added an answer on June 5, 2026 at 10:48 pm

    This part of your create statement might cause problems

    KEY_EVENTS_COLOR + "TEXT," + KEY_EVENTS_START_DATE + "DATE,"
                    + KEY_EVENTS_END_DATE + "TEXT" + ")"
    

    You are missing a space before TEXT everywhere 🙂

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

Sidebar

Related Questions

Okay, here's the situation: We have a table of about 50 columns (created by
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Hey all. Okay here is the situation. I would like to be able to
Okay here's the program I have typed up(stdio.h is included also): /* function main
Okay so here is my situation. About a year ago I released my very
Okay so here's the situation. I have this page of data. After the data
Okay here's the situation. Net 4 WPF NO Silverlight. I have several Views that
Okay, here's the situation. I have two NSManagedObjects called Store and Aisle . There
Okay here is what I'm trying to do: I have a model object that
Okay so here's what I'm doing. I'm making a request to a server to

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.