Help Center

CSQLiteStmt.Finalizemethod

Deletes a prepared statement.

DatabasesmethodCSQLite.incdocumented

Syntax

FUNCTION Finalize () AS LONG

Return value

If the most recent evaluation of the statement encountered no errors or if the statement is never been evaluated, then Finalize returns SQLITE_OK. If the most recent evaluation of a statement failed, then Finalize returns the appropriate error code or extended error code.

Description

Deletes a prepared statement.

Remarks

The Finalize method can be called at any point during the life cycle of prepared statement: before statement is ever evaluated, after one or more calls to Reset, or after any call to Step_ regardless of whether or not the statement has completed execution.

Invoking Finalize on a NULL pointer is a harmless no-op.

The application must finalize every prepared statement in 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.

Reference

  • Include file CSQLite.inc
  • Defined in AfxNova/CSQLite3.inc:1537
  • Documented in Databases/CSQLite Class.md
  • Topic: CSQLite Class