How can I get the list of all the available tables in sqlite programmatically?
Asked
Active
Viewed 2.4k times
16
-
@MaheshBabu: Jhaliya's answer is correct according to me. So please try that out. – Parth Bhatt Mar 17 '11 at 05:25
-
Possible duplicate of [How to list the tables in an SQLite database file that was opened with ATTACH?](http://stackoverflow.com/questions/82875/how-to-list-the-tables-in-an-sqlite-database-file-that-was-opened-with-attach) – KeksArmee Jan 02 '17 at 04:14
3 Answers
34
try this :
SELECT * FROM sqlite_master where type='table';
rofrol
- 13,168
- 7
- 73
- 68
Mitesh Khatri
- 3,897
- 4
- 41
- 67
8
Use the below sql statement to get list of all table in sqllite data base
SELECT * FROM dbname.sqlite_master WHERE type='table';
The same question asked before on StackOverFlow.
How to list the tables in an SQLite database file that was opened with ATTACH?
Community
- 1
- 1
Jhaliya - Praveen Sharma
- 31,542
- 8
- 70
- 75
-
1+1 for your answer because you have even provided the link in case it is not clear. :-) – Parth Bhatt Mar 17 '11 at 05:26