sqlite3简单使用的详解

sqlite3简单使用的详解

ID:34708008

大小:54.55 KB

页数:3页

时间:2019-03-09

sqlite3简单使用的详解_第1页
sqlite3简单使用的详解_第2页
sqlite3简单使用的详解_第3页
资源描述:

《sqlite3简单使用的详解》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、SQLite3返回值的意思:#defineSQLITE_OK0/*Successfulresult*//*beginning-of-error-codes*/#defineSQLITE_ERROR1/*SQLerrorormissingdatabase*/#defineSQLITE_INTERNAL2/*InternallogicerrorinSQLite*/#defineSQLITE_PERM3/*Accesspermissiondenied*/#defineSQLITE_ABORT4/*Callbackroutiner

2、equestedanabort*/#defineSQLITE_BUSY5/*Thedatabasefileislocked*/#defineSQLITE_LOCKED6/*Atableinthedatabaseislocked*/#defineSQLITE_NOMEM7/*Amalloc()failed*/#defineSQLITE_READONLY8/*Attempttowriteareadonlydatabase*/#defineSQLITE_INTERRUPT9/*Operationterminatedbysqlit

3、e3_interrupt()*/#defineSQLITE_IOERR10/*SomekindofdiskI/Oerroroccurred*/#defineSQLITE_CORRUPT11/*Thedatabasediskimageismalformed*/#defineSQLITE_NOTFOUND12/*Unknownopcodeinsqlite3_file_control()*/#defineSQLITE_FULL13/*Insertionfailedbecausedatabaseisfull*/#defineSQL

4、ITE_CANTOPEN14/*Unabletoopenthedatabasefile*/#defineSQLITE_PROTOCOL15/*Databaselockprotocolerror*/#defineSQLITE_EMPTY16/*Databaseisempty*/#defineSQLITE_SCHEMA17/*Thedatabaseschemachanged*/#defineSQLITE_TOOBIG18/*StringorBLOBexceedssizelimit*/#defineSQLITE_CONSTRAI

5、NT19/*Abortduetoconstraintviolation*/#defineSQLITE_MISMATCH20/*Datatypemismatch*/#defineSQLITE_MISUSE21/*Libraryusedincorrectly*/#defineSQLITE_NOLFS22/*UsesOSfeaturesnotsupportedonhost*/#defineSQLITE_AUTH23/*Authorizationdenied*/#defineSQLITE_FORMAT24/*Auxiliaryda

6、tabaseformaterror*/#defineSQLITE_RANGE25/*2ndparametertosqlite3_bindoutofrange*/#defineSQLITE_NOTADB26/*Fileopenedthatisnotadatabasefile*/#defineSQLITE_ROW100/*sqlite3_step()hasanotherrowready*/#defineSQLITE_DONE101/*sqlite3_step()hasfinishedexecuting*//*end-of-er

7、ror-codes*/关于事物intresult;result=sqlite3_exec(db,"begintransaction",0,0,&zErrorMsg);//开始一个事务result=sqlite3_exec(db,"committransaction",0,0,&zErrorMsg);//提交事务result=sqlite3_exec(db,"rollbacktransaction",0,0,&zErrorMsg);//回滚事务关于SQLite3和标准sql之间的差异和用法(不全)1.sql语句中不能使用to

8、p关键字,比如:SELECTTOPx*FROMtable_nameWHERE....ORDERBY....DESC检索到的记录按降序排,取其前x条记录。在sqlite中应该这样写:SELECT*FROMtable_nameWHERE....ORDERBY....DESCLIMIT0,x2.拷贝表数据,拷

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。