CSQLiteStmt.ColumnBlobmethod
Returns information about a single column of the current result row of a query.
Syntax
FUNCTION ColumnBlob (BYVAL nCol AS LONG) AS ANY PTR
FUNCTION ColumnBlob (BYREF wszColName AS WSTRING) AS ANY PTR
Parameters
| Name | Description | |
|---|---|---|
nCol / wszColName | The index or the name of the column for which information should be returned. The leftmost column of the result set has the index 0. The number of columns in the result can be determined using ColumnCount. |
Return value
The column value as a pointer to a blob.
Description
Returns information about a single column of the current result row of a query.
Remarks
If the SQL statement does not currently point to a valid row, or if the column index is out of range, the result is undefined. ColumnLong may only be called when the most recent call to Step_ has returned SQLITE_ROW and neither Reset nor Finalize have been called subsequently. If any of these functions are called after Reset or Finalize or after Step_ has returned something other than SQLITE_ROW, the results are undefined. If Step_ or Reset or Finalize are called from a different thread while ColumnBlob is pending, then the result is undefined.
The return value from ColumnBlob for a zero-length BLOB is a NULL pointer.
ColumnBlob attempts to convert the value where appropriate. The following table details the conversions that are applied:
The table above makes reference to standard C library functions atoi() and atof(). SQLite does not really use these functions. It has its own equivalent internal functions. The atoi() and atof() names are used in the table for brevity and because they are familiar to most C programmers.
The pointer returned is valid until Step_ or Reset or Finalize is called. The memory space used to hold BLOBs is freed automatically. Do not pass the pointers returned by ColumnBlob into Free.
If a memory allocation error occurs during the evaluation of any of these functions, a default value is returned. The default value is a NULL pointer. Subsequent calls to ErrCode will return SQLITE_NOMEM.
Reference
- Include file
CSQLite.inc - Defined in AfxNova/CSQLite3.inc:2052
- Documented in Databases/CSQLite Class.md
- Topic: CSQLite Class