Name
sqlite3_value_bytes() — Get the size of an SQL function parameter
Definition
int sqlite3_value_bytes( sqlite3_value* value ); int sqlite3_value_bytes16( sqlite3_value* value );
-
value An SQL function parameter value.
- Returns
The number of bytes in the SQL function parameter value.
Description
These functions return the number of bytes in a text or BLOB
value. Calling these functions can cause a type conversion
(invalidating buffers returned by sqlite3_value_xxx()), so care must be taken to
call them in conjunction with the appropriate sqlite3_value_xxx()
function.
To avoid problems, an application
should first extract the desired type using an sqlite3_value_xxx()
function, and then call the appropriate sqlite3_value_bytes() function. The functions
sqlite3_value_text()
and sqlite3_value_blob()
should be followed by a call to sqlite3_value_bytes(), while any call to an
sqlite3_value_text16xxx() should be followed by
a call to sqlite3_value_bytes16().
If these functions are called for a non-text or non-BLOB value, the value will first be converted to an appropriately encoded text value, then the length of that text value will be returned.
In most other regards, these functions are nearly identical to
the sqlite3_column_bytes()
functions.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access