标签:
//修改学生数据 func updateStudents(){ //准备sql语句 let string:NSString = "update Student set score = 100 where name like ‘a%‘" let sql = string.UTF8String //执行sql语句 if sqlite3_exec(db, sql, nil, nil, nil) != SQLITE_OK { sqlite3_close(db) print("update failed") } }
//删除学生数据 func deleteStudents(){ //准备sql语句 let string:NSString = "delete from Student where score < 60" let sql = string.UTF8String //执行sql语句 if sqlite3_exec(db, sql, nil, nil, nil) != SQLITE_OK { sqlite3_close(db) print("delete failed") } }
标签:
原文地址:http://www.cnblogs.com/ybw123321/p/5244382.html