Reputation: 6718
Can anyone please tell me how can I get all the column names used in a database table in Android?
Upvotes: 1
Views: 158
Reputation: 4921
access cursor property 0,1,2 pass as many column u have
Upvotes: 2
Reputation: 5903
Two possible ways i can think of:
PRAGMA table_info(yourTable)
or
SELECT * FROM yourTable LIMIT 0
To get all tables:
SELECT * FROM sqlite_master WHERE type = 'table'
Upvotes: 0