微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

sqlite3_finalize()

Destroy A Prepared Statement Object

int sqlite3_finalize(sqlite3_stmt *pStmt);

The sqlite3_finalize() function is called to delete aprepared statement. If the most recent evaluation of the statement encountered no errors or if the statement is never been evaluated,then sqlite3_finalize() returns sqlITE_OK. If the most recent evaluation of statement S Failed,then sqlite3_finalize(S) returns the appropriateerror codeorextended error code.

The sqlite3_finalize(S) routine can be called at any point during the life cycle ofprepared statementS: before statement S is ever evaluated,after one or more calls tosqlite3_reset(),or after any call tosqlite3_step()regardless of whether or not the statement has completed execution.

Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op.

The application must finalize everyprepared statementin order to avoid resource leaks. It is a grievous error for the application to try to use a prepared statement after it has been finalized. Any use of a prepared statement after it has been finalized can result in undefined and undesirable behavior such as segfaults and heap corruption.

See also lists ofObjects,Constants,andFunctions.

原文地址:https://www.jb51.cc/sqlite/201874.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐