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 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

So far I've managed to create this method for inserting into a SQLite database
hai i a'm trying to create a sqlite database programmatically at the run time.
I'm trying to set up a simple SQLite database in Android, handling the schema
I'm trying to connect to SQLite database with Ecplise but I have some errors.
I'm trying to use sqlite in a 'data services' class like below. I keep
I can successfully use Python to create a database and run the execute() method
I'm trying to implement a ContentProvider wrapped around an SQLite database. I've followed the
I'm trying to create a table in android database, but when i try to
I have a database with 1000 records. I am trying to create an SQL
I am trying to create a method to retrieve the max id of 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.