Name

sqlite3_sql() — Get the SQL of a prepared statement

Definition

const char* sqlite3_sql( sqlite3_stmt stmt );
stmt

A prepared statement.

Returns

The SQL string used to prepare a statement.

Description

This function returns the original SQL string used to prepare the given statement. The statement must have been prepared with a _v2 version of prepare. If the statement was prepared with the original sqlite3_prepare() or sqlite3_prepare16() functions, this function will always return NULL.

The returned statement will always be encoded in UTF-8, even if sqlite3_prepare16_v2() was used to prepare the statement.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.