SQLite的sqlite3_prepare_v2

更新时间:2023-07-05 10:19:00 阅读: 评论:0

SQLite的sqlite3_prepare_v2审美文化
求职经验original SQL text---<sqlite3_prepare_v2>--->sqlite3_stmt--<sqlite3_ret>-->clear sqlite3_stmt --<sqlite3_bind_*(stmt,1,*)>--> configed sqlite3_stmt
--<sqlite3_step()>--->run sqlite3_stmt---<sqlite3_column_*(statement, N)>--->查询输出----<sqlite3_finalize()>--->释放语句
/*
** CAPI3REF: Prepared Statement Object
** KEYWORDS: {prepared statement} {prepared statements}
**
** An instance of this object reprents a single SQL statement that
** has been compiled into binary form and is ready to be evaluated.
**
** Think of each SQL statement as a parate computer program.  The
大字成语
** original SQL text is source code.  A prepared statement object
柳永** is the compiled object code.  All SQL must be converted into a
** prepared statement before it can be run.
**
** The life-cycle of a prepared statement object usually goes like this:
**
** <ol>
** <li> Create the prepared statement object using [sqlite3_prepare_v2()].
** <li> Bind values to [parameters] using the sqlite3_bind_*()
母亲的手**      interfaces.
** <li> Run the SQL by calling [sqlite3_step()] one or more times.
** <li> Ret the prepared statement using [sqlite3_ret()] then go back
**      to step 2.  Do this zero or more times.
** <li> Destroy the object using [sqlite3_finalize()].
** </ol>
-(void)lect{
NSString * sqlString = @"lect * from person";
获得管理员权限//准备sql语句
sqlite3_stmt * stmt = nil;
sqlite3_prepare(db, sqlString.UTF8String, -1, &stmt, nil);
//单步执⾏语句
while (sqlite3_step(stmt) == SQLITE_ROW) {
哑铃臂屈伸const unsigned char * name = sqlite3_column_text(stmt, 0);
NSString * nameStr = [NSString stringWithUTF8String:(const char*)name];        int age = sqlite3_column_int(stmt, 1);
NSLog(@"name:::%@ and age:::%d",nameStr,age);
}
//释放
sqlite3_finalize(stmt);品质管理流程
}

本文发布于:2023-07-05 10:19:00,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1068661.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:准备   管理员   权限   管理   文化   经验   输出   成语
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图