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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:46:44+00:00 2026-05-23T03:46:44+00:00

I am trying to create an SQLite database. The create method: private static class

  • 0

I am trying to create an SQLite database. The create method:

private static class DatabaseHelper extends SQLiteOpenHelper {

    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(CREATE_BASE_TABLE);
    }

}

(the constructor and the upgrade function are implemented in that private class as well)

is calling the SQL string:

static final String CREATE_BASE_TABLE ="create table if not exists tableData ("
        + "id INTEGER PRIMARY KEY,"
        + "name TEXT,"
        + "image TEXT,"
        + "var1 TEXT,"
        + "var2 TEXT,"
        + ");";

but the execSQL returns success=false , as revealed by the debugger and breakpoints.

In File Explorer I see that data is created in the databases folder. I open that file on my local machine and only see a table called android_metadata not tableData and my fields are nowhere to be seen!

How do I fix it to make my method properly populate my table? Is there a syntax issue with my query?

  • 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-05-23T03:46:44+00:00Added an answer on May 23, 2026 at 3:46 am

    It’s very subtle but the error is in your create table command. This line should not have a comma:

    + "var2 TEXT,"
    

    Instead, it should just be:

    + "var2 TEXT"
    

    since it is the last column you are defining.

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

Sidebar

Related Questions

I have a DB helper class which extends SQLiteOpenHelper and in onCreate, I want
I am trying to insert rows into a SQLite database within Android. A call
I'm trying to write to a local SQLite database using the flash.data.* classes in
I am trying to define simple getter/setter methods for a mixin class that I
On the Emulator the app runs fine. On the device the moment im trying
am having a little trouble here. i am trying to store and retrieve images
I'm adding a table to my app's SQLite DB. All my syntax there is
My team were previously using Qt 4.3 and are trying to update to the
I'm a final year university IT Student and I'm having an issue trying to
hi to all i have a table that is named books and it has

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.