본문 바로가기

iPhone dev./SQLite, FMDatabase

How to get table list of sqlite in iphone

stackoverflow.com 참조:

I am creating a Sqlite database using terminal and integrating this database in my application.

I need to get list of all the tables in the database. I know that in the terminal .tables displays list of all the tables in database but how do I do the same thing programatically.

Could someone point me in the right direction?

(Let me know if my question isn't entirely clear)

link|edit

@MaheshBabu: Jhaliya's answer is correct according to me. So please try that out. – Parth Bhatt Mar 17 '11 at 5:25
feedback

2 Answers

try this :

SELECT * FROM sqlite_master where type='table'
link|edit
feedback

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 do I list the tables in a SQLite database file

link|edit
+1 for your answer because you have even provided the link in case it is not clear. :-) – Parth Bhatt Mar 17 '11 at 5:26
feedback


'iPhone dev. > SQLite, FMDatabase' 카테고리의 다른 글

mysql ALTER 명령어  (0) 2012.04.11