1. Open the database
int Sqlite3_open (
Const char *filename, // file path for database
Sqlite3 **ppdb // DB instance
);
2. execute any SQL statement
int sqlite3_exec (
sqlite3*, // an open DB instance
Const char *sql, // SQL statement to execute
int (*callback) (void*,int,char **,char **), callback after execution of the SQL statement
void *, // 1 parameters of the callback function
Char **errmsg // error message
);
3. Check the legality of the SQL statement (pre-query preparation)
int SQLITE3_PREPARE_V2 (
Sqlite3 *db, // DB instance
Const char *zsql, // SQL statement to check
int nbyte, // maximum byte length for SQL statements
Sqlite3_stmt **ppstmt, //sqlite3_stmt instance, used to obtain database data
Const char **pztail
);
4. querying a row of data
int sqlite3_step (sqlite3_stmt*); // If a row of data is queried, the Sqlite_row is returned
5. use stmt to get the value of a field (the subscript of a field starts with 0)
Double sqlite3_column_double (sqlite3_stmt*, int icol); // floating point data
int sqlite3_column_int (sqlite3_stmt*, int icol); // integer data
Sqlite3_int64 Sqlite3_column_int64 (sqlite3_stmt*, int icol); // long-integer data
Const void *sqlite3_column_blob (sqlite3_stmt*, int icol); //binary text data
Const unsigned char *sqlite3_column_text (sqlite3_stmt*, int icol); // string data
IOS SQLite Function Summary