欢迎来到天天文库
浏览记录
ID:34708008
大小:54.55 KB
页数:3页
时间:2019-03-09
《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.拷贝表数据,拷
此文档下载收益归作者所有