Archive for 'Stmt'

Executing a query in sqlite3 in xcode

sqlite3_step(statement);

This is the code to execute a query in sqlite3. Here statement is the sqlite3_stmt object, declared as follows
sqlite3_stmt *statement;

This is the code used to get the string result from a query in sqlite3. Here the obtained result is a char value and we have to convert it to NSString. Here, the first argument is statement, which is the sqlite3_stmt object, declared as follows
sqlite3_stmt *statement;
The second argument is the integer value, which represent the column index from the query.

sqlite3_column_int(statement, 0);

This is the code used to get the integer result from a query in sqlite3. Here the first argument is statement, which is the sqlite3_stmt object, declared as follows

sqlite3_stmt *statement;

The second argument is the integer value, which represent the column index from the query.