値がBLOB typeとして格納されるテーブル フィールドがあります。BLOB 内の異なるバイト位置から異なる値を取得できるように、バイナリ配列として取得する必要があります。どんな助けでも大歓迎です。
1 に答える
0
// Get the start and length of the blob.
// (remember column indexes are 0-based when fetching the value
// but 1-base when binding - yeah cheers!)
uint8_t *data = (uint8_t *)sqlite3_column_blob(stmt, columnIndex);
size_t length = (size_t)sqlite3_column_bytes(stmt, columnIndex);
// And now you can access the data
unsigned sum = 0;
for (size_t i = 0; i < length; i++)
sum += data[i];
于 2012-08-25T08:33:09.037 に答える