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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:52:14+00:00 2026-06-03T12:52:14+00:00

I have one application on android market , now i want to change the

  • 0

I have one application on android market , now i want to change the database filed . I want to add two new field to particular table.Can you help me how to add two new columns to table ?

Here is my code.

 private static final String ALTER_USER_TABLE = "ALTER TABLE user_table ADD user_society text,user_street1 text;"; 

 @Override
 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
 {
    db.execSQL(ALTER_USER_TABLE);
 }

I got the following error after executing .

W/System.err(  717): android.database.sqlite.SQLiteException: near ",": syntax error: ALTER TABLE user_table ADD user_society text,user_street1 text;
W/System.err(  717):    at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
W/System.err(  717):    at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1727)
W/System.err(  717):    at com.kbobs.org.database.Database$DatabaseHelper.onUpgrade(Database.java:48)
W/System.err(  717):    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:108)
W/System.err(  717):    at com.kbobs.org.database.Database.OpenDatabase(Database.java:54)
W/System.err(  717):    at com.kbobs.org.ui.Login$2.handleMessage(Login.java:222)
W/System.err(  717):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  717):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  717):    at android.app.ActivityThread.main(ActivityThread.java:4627)
W/System.err(  717):    at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(  717):    at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err(  717):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
W/System.err(  717):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  • 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-03T12:52:16+00:00Added an answer on June 3, 2026 at 12:52 pm

    You can only add one column at a time. Split it into two ALTER TABLE statements and you should be fine.

    private static final String ALTER_USER_TABLE_ADD_USER_SOCIETY = 
        "ALTER TABLE user_table ADD user_society TEXT";
    private static final String ALTER_USER_TABLE_ADD_USER_STREET1 = 
        "ALTER TABLE user_table ADD user_street1 TEXT";
    
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
    {
       db.execSQL(ALTER_USER_TABLE_ADD_USER_SOCIETY);
       db.execSQL(ALTER_USER_TABLE_ADD_USER_STREET1);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application published in the android market, and now I want to
I have developed one application in android and now I wish to add one
i have one application which is build using VB.NET now i required to add
I want to upload the same application twice to the Android Market. One version
I have created android application now I want to launch the .Apk of that
I am developing one application in android. In this I have to login into
I'm developing an Android application. On one activity I have a List with list
In an Android application, similar to an application market, I have a Home view
now I am doing an Android application.I have to read a file from sdcard.I
I have updated an android application and pushed it to the Market. On 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.