Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Column Name

I am working on IPhone Application and I want to integrate SQLite in my application.

I want ro get Column name which are retrieve in my sql query

For Example

SELECT name, phoneNo FROM contectInfo;

In the sql query I am getting proper data, but I want to know, How Can I get the column name that are name and phoneNo?

Can any one Help me to find out this solution?

like image 522
Crazy Developer Avatar asked Oct 12 '22 16:10

Crazy Developer


1 Answers

You can access column name in Objective C

N will be the column number.

const char *sqlite3_column_name(sqlite3_stmt*, int N);

or you can get list of column names using

PRAGMA table_info(table_name);
like image 113
Mayur Birari Avatar answered Oct 31 '22 11:10

Mayur Birari