Data needs to be stored in relational databases (also the mainstream database of mobile clients ). : Indicates that the value is NULL: unsigned integer value: floating point value: text string: binary data (such as files)
• Import the master header file. This is a library.
NSString *dbPath = [ NSLog( _db = (SQLITE_OK == sqlite3_open([dbPath UTF8String], & NSLog( } NSLog( }
Mark One-Step SQL Execution-() execSQL :( NSString *) SQL message :( NSString ** errmsg = (SQLITE_ OK = sqlite3_exec (_ db, [SQL UTF8String], NULL, NULL, & NSLog (
NSString *sql = [self execSQL:sql message:];
NSString *sql = [NSString stringWithFormat: [self execSQL:sql message:];
- ()updatePerson:(Person * NSString *sql = [NSString stringWithFormat: [self execSQL:sql msg: }
- ( NSString *sql = [NSString stringWithFormat: [self execSQL:sql msg: }
Check the validity of the SQL statement. Obtain the query result row by row to obtain the corresponding content and release it.
NSString *sql = sqlite3_stmt *stmt = (SQLITE_OK == sqlite3_prepare_v2(_db, [sql UTF8String], -, & NSLog( (SQLITE_ROW == ID = sqlite3_column_int(stmt, unsigned *name = sqlite3_column_text(stmt, age = sqlite3_column_int(stmt, gender = sqlite3_column_int(stmt, CGFloat height = sqlite3_column_double(stmt, NSString *nameUTF8 = [NSString stringWithUTF8String:( * Person *p = NSLog( } NSLog( }
Clear Saup