C S <[EMAIL PROTECTED]> wrote:
>  thanks for the tip on the hex. now i can see my
> entry of the blob. my original loop to fill the
> dynamic array with unsigned shorts was this:
>
> imageArray = new unsigned short[10];
>
> for(int i = 0; i < 10; i++)
>  imageArray[i] = i;
>
> so now if i run the program then do a:
>
> select imageID, hex(imageData) from Images;
>
> i get the result:
>
> 1|0000010002000300040005000600070008000900
>
> i am not sure where the first 2 leading zeros are
> coming from

The first value (the one at index 0) in imageArray is zero, represented 
by two zero bytes.

> now i need to be able to extract the data back out of
> the blob with sqlite3_column_blob and
> sqlite3_column_bytes so that i can repopulate an
> unsigned short array.
>
> if i have multiple blobs in the table Images how would
> i go about retrieving back all this information?

You prepare a select statement, e.g.

select imageID, imageData from Images;

Then you loop over all rows in the resultset with sqlite3_step call 
(each call advances to the next row), and for each row call 
sqlite3_column_* once for each column you are interested in.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to