int sqlite3_value_numeric_type( sqlite3_value* value );
value
An SQL function parameter value.
A datatype code.
This function attempts to convert the given parameter
value into a numeric type. If the value can be converted into an
integer or floating-point number without loss of data, the
conversion is done and the type SQLITE_INTEGER or SQLITE_FLOAT will be returned.
If a conversion would result in lost data, the conversion is not
done and the original datatype is returned. In that case, the
type may be SQLITE_TEXT,
SQLITE_BLOB, or
SQLITE_NULL.
The difference between this function and simply calling a
function like sqlite3_value_int() is the conversion function.
This function will only perform the conversion if the original
value is fully consumed and makes sense in a numeric context.
For example, sqlite3_value_int()
will convert a NULL into the value
0, where this function will not. Similarly, sqlite3_value_int()
will convert the string 123xyz into the integer value 123 and ignore
the trailing xyz. This
function will not allow that conversion, however, because no
sense can be made of the trailing xyz in a numeric context.