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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:59:57+00:00 2026-06-14T20:59:57+00:00

I am creating an application that has a default table that stores what the

  • 0

I am creating an application that has a default table that stores what the other tables are so that when your trying to put your own input into the app it will store the tables but when you try to add a table to the default table it works perfectly unless there is a space “test” would work perfect “test 1” would crash the app. This is my code retrieving the String that is inputed by the user:

t = new Table(this);
t.open();
final AlertDialog.Builder alert = new AlertDialog.Builder(this);
final EditText input = new EditText(this);
alert.setView(input);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {
        rListName = input.getText().toString();
        t.createNew(rListName + "DB");
        t.createList(rListName, rListName + "DB");
        t.close();
    }
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {
        dialog.cancel();
    }
});
alert.show();

This is my createNew and createList:

public void createNew(String TABLE_NAME){
if(DATABASE_STATUS == "new"){
    ourHelper.createNew(ourDatabase, TABLE_NAME);
    System.out.println("Creating " + TABLE_NAME);
}else{
    System.out.print("Already Created");
    }
}


public long createList(String listName, String listDB){
    ContentValues cv = new ContentValues();
    cv.put(KEY_LISTNAME, listName);
    cv.put(KEY_LISTDB, listDB);
    return ourDatabase.insert(DEFAULT_TABLE, null, cv);
}

my createNew() that is executed to make new tables

public void createNew(SQLiteDatabase db, String TABLE_NAME){
    db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + 
    KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
    KEY_QUESTION + " TEXT NOT NULL, " +
    KEY_PATH + " TEXT NOT NULL);"
    );
}

last but not lease, my logcat:

11-25 22:02:30.418: I/SqliteDatabaseCpp(24726): sqlite returned: error code = 1, msg = near "helloDB": syntax error
11-25 22:02:30.428: D/AndroidRuntime(24726): Shutting down VM
11-25 22:02:30.428: W/dalvikvm(24726): threadid=1: thread exiting with uncaught exception (group=0x40ab9228)
11-25 22:02:30.438: E/AndroidRuntime(24726): FATAL EXCEPTION: main
11-25 22:02:30.438: E/AndroidRuntime(24726): android.database.sqlite.SQLiteException: near "helloDB": syntax error: , while compiling: CREATE TABLE hello helloDB (_id INTEGER PRIMARY KEY AUTOINCREMENT, question TEXT NOT NULL, path TEXT NOT NULL);
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:68)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:141)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:368)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteStatement.acquireAndLock(SQLiteStatement.java:272)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:84)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:2031)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1971)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.mitterederStudios.Quiz.Table$DbHelper.createNew(Table.java:49)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.mitterederStudios.Quiz.Table.createNew(Table.java:94)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.mitterederStudios.Quiz.Menu$1.onClick(Menu.java:56)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:174)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.os.Looper.loop(Looper.java:154)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at android.app.ActivityThread.main(ActivityThread.java:4945)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at java.lang.reflect.Method.invokeNative(Native Method)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at java.lang.reflect.Method.invoke(Method.java:511)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-25 22:02:30.438: E/AndroidRuntime(24726):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-25 22:02:30.438: E/AndroidRuntime(24726):    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-14T20:59:59+00:00Added an answer on June 14, 2026 at 8:59 pm

    You need to put quotes around your table name so its “test 1” if you really want spaces. However this is generally a bad idea, I would replace the spaces with underscores so it becomes test_1.

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

Sidebar

Related Questions

I am creating a business application that has a variable width sidebar and content
I am creating an ASP.NET MVC application that has postcode lookup functionality. I capture
Here's something that has been bugging me... I am currently creating an application for
I am creating a web application that will have many users. Each user has
We're creating an application that understands some command-line parameters. There are some default's we
I am creating a very simple application that only has a seek bar that
I'm creating an application that allows the user to store information about their classes.
I will be creating an Application that will be showing the Products in a
I am creating an application that supports modules in the form of dlls that
I am creating an application that works like the 'wizard' component of some microsoft

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.