IOS-Brief introduction to the basic use of iOS mobile client SQLite3

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.