Sq3StmtC - Retrieving Statement SQL … More...
Functions | |
static MK_STR | Sq3StmtExpandedSql (SQ3_STMT pStmt) |
Retrieving Statement SQL … | |
static MK_STRN | Sq3StmtSql (SQ3_STMT pStmt) |
Retrieving Statement SQL … | |
static MK_STRN | Sq3StmtGetPzTail (SQ3_STMT sq3stmt) |
return the non compiled sql-statement from Sq3StmtPrepareV2 and Sq3StmtPrepareV3 … | |
Sq3StmtC - Sq3StmtC_Sql_C_API - function | |
MK_STR | Sq3StmtExpandedSqlP (SQ3_STMT pStmt) |
Non-inline replacement for Sq3StmtExpandedSql … | |
MK_STRN | Sq3StmtGetPzTailP (SQ3_STMT sq3stmt) |
Non-inline replacement for Sq3StmtGetPzTail … | |
MK_STRN | Sq3StmtSqlP (SQ3_STMT pStmt) |
Non-inline replacement for Sq3StmtSql … | |
Sq3StmtC - Retrieving Statement SQL …
Retrieving Statement SQL …
The Sq3StmtSql(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 Sq3StmtPrepareV2 (), Sq3StmtPrepareV3 (), sqlite3_prepare16_v2 (), or sqlite3_prepare16_v3 (). The Sq3StmtExpandedSql(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 Sq3StmtSql() will return the original string, "SELECT $abc,:xyz" but Sq3StmtExpandedSql() will return "SELECT 2345,NULL".
The Sq3StmtExpandedSql() 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 SQ3_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 Sq3StmtExpandedSql() to always return NULL.
The strings returned by Sq3StmtSql(P) and sqlite3_normalized_sql(P) are managed by SQLite and are automatically freed when the prepared statement is finalized. The string returned by Sq3StmtExpandedSql(P), on the other hand, is obtained from Sq3Malloc () and must be freed by the application by passing it to Sq3Free ().
The sqlite3_normalized_sql() interface is only available if the SQLITE_ENABLE_NORMALIZE compile-time option is defined.
Reference code from sqlite3:
Definition at line 410 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtExpandedSql …
return the non compiled sql-statement from Sq3StmtPrepareV2 and Sq3StmtPrepareV3 …
Return the pzTail from Sq3StmtPrepareV2 and Sq3StmtPrepareV3. if None
than a MK_NULL_STR is returned.
If pzTail is not NULL then *pzTail is made to point to the first byte past the end of the first SQL statement in zSql. These routines only compile the first statement in zSql, so *pzTail is left pointing to what remains uncompiled.
[in] | sq3stmt | the Sq3StmtC instance to work on a statement |
Definition at line 545 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtGetPzTail …
Retrieving Statement SQL …
read more at 'Sq3StmtExpandedSql'
Definition at line 417 of file Sq3StmtC_sq3.h.
Non-inline replacement for Sq3StmtSql …