Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to drop database in sqlite?

Tags:

android

sqlite

I'm using SQLite in android. I want to drop the database.

For example: mysql- drop database dbname

How do I implement this code in SQLite?

like image 620
Rajesh Sharma Avatar asked Mar 16 '11 14:03

Rajesh Sharma


People also ask

How do I drop in SQLite?

To drop a table in SQLite, use the DROP TABLE statement. Running this statement removes the table from the database. It is completely removed from the database schema and the disk file. Therefore the table can not be recovered.

How do I delete a sqlite3 database?

Like most relational database systems, SQLite does not use the DROP DATABASE command to drop a database and there is no special syntax or steps to drop the database in SQLite. You just have to delete the file manually. Here filename is always unique i.e. database name is always unique and it is case-sensitive.

How do I delete a SQLite database in Linux?

SQLite stores its databases as a normal file within the computer's file system, so creating and dropping databases is not really applicable. If you need to completely remove a database, you will need to delete the database file from the file system. Then you can navigate to the file in the file system and delete it.


1 Answers

to delete your app database try this:

 this.deleteDatabase("databasename.db"); 

this will delete the database file

like image 95
thenosic Avatar answered Oct 18 '22 17:10

thenosic