From 63847496f14c813a5d80efd5b7de0f1294ffe1e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:07:11 +0200 Subject: Adding upstream version 3.45.1. Signed-off-by: Daniel Baumann --- www/c3ref/expanded_sql.html | 171 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 www/c3ref/expanded_sql.html (limited to 'www/c3ref/expanded_sql.html') diff --git a/www/c3ref/expanded_sql.html b/www/c3ref/expanded_sql.html new file mode 100644 index 0000000..81e23c8 --- /dev/null +++ b/www/c3ref/expanded_sql.html @@ -0,0 +1,171 @@ + + + + + +Retrieving Statement SQL + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Retrieving Statement SQL

+
+
+const char *sqlite3_sql(sqlite3_stmt *pStmt);
+char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
+#ifdef SQLITE_ENABLE_NORMALIZE
+const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
+#endif
+
+

+The sqlite3_sql(P) interface returns a pointer to a copy of the UTF-8 +SQL text used to create prepared statement P if P was +created by sqlite3_prepare_v2(), sqlite3_prepare_v3(), +sqlite3_prepare16_v2(), or sqlite3_prepare16_v3(). +The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8 +string containing the SQL text of prepared statement P with +bound parameters expanded. +The sqlite3_normalized_sql(P) interface returns a pointer to a UTF-8 +string containing the normalized SQL text of prepared statement P. The +semantics used to normalize a SQL statement are unspecified and subject +to change. At a minimum, literal values will be replaced with suitable +placeholders.

+ +

For example, if a prepared statement is created using the SQL +text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345 +and parameter :xyz is unbound, then sqlite3_sql() will return +the original string, "SELECT $abc,:xyz" but sqlite3_expanded_sql() +will return "SELECT 2345,NULL".

+ +

The sqlite3_expanded_sql() interface returns NULL if insufficient memory +is available to hold the result, or if the result would exceed the +the maximum string length determined by the SQLITE_LIMIT_LENGTH.

+ +

The SQLITE_TRACE_SIZE_LIMIT compile-time option limits the size of +bound parameter expansions. The SQLITE_OMIT_TRACE compile-time +option causes sqlite3_expanded_sql() to always return NULL.

+ +

The strings returned by sqlite3_sql(P) and sqlite3_normalized_sql(P) +are managed by SQLite and are automatically freed when the prepared +statement is finalized. +The string returned by sqlite3_expanded_sql(P), on the other hand, +is obtained from sqlite3_malloc() and must be freed by the application +by passing it to sqlite3_free().

+ +

The sqlite3_normalized_sql() interface is only available if +the SQLITE_ENABLE_NORMALIZE compile-time option is defined. +

See also lists of + Objects, + Constants, and + Functions.

+ -- cgit v1.2.3