Small. Fast. Reliable.
Choose any three.

About Sitemap Documentation Download License News Developers Support

## SQLite C Interface

## Retrieving Statement SQL

>     const char *sqlite3_sql(sqlite3_stmt *pStmt);

This interface can be used to retrieve a saved copy of the original SQL text used to create a prepared statement if that statement was compiled using either sqlite3_prepare_v2() or sqlite3_prepare16_v2().

### Invariants:

H13101 | If the prepared statement passed as the argument to sqlite3_sql() was compiled using either sqlite3_prepare_v2() or sqlite3_prepare16_v2(), then sqlite3_sql() returns a pointer to a zero-terminated string containing a UTF-8 rendering of the original SQL statement.
H13102 | If the prepared statement passed as the argument to sqlite3_sql() was compiled using either sqlite3_prepare() or sqlite3_prepare16(), then sqlite3_sql() returns a NULL pointer.
H13103 | The string returned by sqlite3_sql(S) is valid until the prepared statement S is deleted using sqlite3_finalize(S).

See also lists of Objects, Constants, and Functions.

This page last modified 2008/08/11 17:57:43 UTC