davidcesarino
davidcesarino

Reputation: 16209

Retrieve a list of all tables in the database

I have this database file under the usual databases folder and a bunch of tables inside it.

Please note that I don't want to retrieve under the command line. I know I can use the ".tables" command.

I want to retrieve a list of all tables in it, using code, so that I can execute some specific algorithms on each of them.

Also, I didn't find any questions with this problem on Android, so please forgive me if there is any. I was wondering if there is any function I can use under DatabaseUtils, but I didn't find any either.

Upvotes: 5

Views: 6864

Answers (1)

Diego Torres Milano
Diego Torres Milano

Reputation: 69188

Use

select name from sqlite_master where type = 'table'

Upvotes: 14

Related Questions