tags:

views:

23

answers:

2

Hi, Can anyone please tell me how can I get all the column names used in a database table in Android..?

A: 

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'
bassfriend
+1  A: 
  • c.getColumnName(0)

access cursor property 0,1,2 pass as many column u have

ud_an
Thanks it worked :)
Saurabh Verma
welcome.............. :)
ud_an