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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:36:17+00:00 2026-06-13T16:36:17+00:00

I try to drop table programmatically nothing error show in logcat, but there has

  • 0

I try to drop table programmatically nothing error show in logcat, but there has no any result :

Here my Database Helper class :

public class database1 extends SQLiteOpenHelper
{
    private static final String DB_Name="database";
    private static final int DB_Version=1;
    private static final String tbl_arrival1="arrival1";
    private static final String STRING_CREATE1 = "CREATE TABLE IF NOT EXISTS "+tbl_arrival1
            +" (_f_id INTEGER PRIMARY KEY AUTOINCREMENT, "
            +"f_date TEXT,"
            +"o_rder NUMERIC,"
            +"rem_com TEXT);";
    public database1 (Context ctx)
    {
        super(ctx,DB_Name,null,DB_Version);
    }
    @Override
    public void onCreate(SQLiteDatabase database) {
        databaseQuery.onCreate(database);
      }
    public static class databaseQuery 
    {
        public static void onCreate(SQLiteDatabase database)
        {   
            database.execSQL("DROP TABLE IF EXISTS "+tbl_arrival1);
            database.execSQL(STRING_CREATE1);
        }
    }
}

I use this database helper in content provider :

database1 DBHelper ;
public Uri insert(Uri uri, ContentValues values) 
    {
        long row_id;
        SQLiteDatabase sqlDB = DBHelper.getWritableDatabase();
        row_id=sqlDB.insert(tbl_arrival1, null, values);
        if(row_id>0)
        {
            Uri _uri = ContentUris.withAppendedId(CONTENT_URI, row_id);
            getContext().getContentResolver().notifyChange(_uri, null);
            return _uri;
        }
        throw new SQLException("Failed to insert into "+uri);
    }

The problem is that, the query drop table, is not working!

All suggestion and answer would be highly appreciated…

thanks

  • 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-13T16:36:19+00:00Added an answer on June 13, 2026 at 4:36 pm

    onCreate will work only once at time of creation once the database is created you should make use of onUpgrade() to drop table if any changes has been made to old version

    EDIT
    http://www.vogella.com/articles/AndroidSQLite/article.html

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

Sidebar

Related Questions

In my database i have the table AndroidGameMode but when i try to insert
When I try to drop a table, MySQL hangs. I don't have any other
here is my tables: DROP TABLE IF EXISTS `tbl_comments`; CREATE TABLE IF NOT EXISTS
I have a question about my database. I try to delete my database but
I got this code.. ..... try: task_db.cursor.execute('DROP TABLE IF EXISTS `tasks`') print Affected: %d
I am getting a table not found error. I googled a lot but not
$(item).droppable({ drop: function(event, ui) { console.log(triggered); } }); I try to call drop by
I try to drop unique constraint for column in h2, previously created as info
i need to try for the drop down with name of the month ,
I'll try to explain this the best I can. I have a drop down

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.