2012-08-25 14 views

回答

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]; 
+0

感谢您的回复,我会很快确认答案 –