C S wrote:
> 
> i get nothing. i have a printout statement to make
> sure an imageID was created and it was successfully.
> the array is indeed dynamic and has to be. to echo
> this is what i have:
> 
> myString = "insert into Images(imageID, imageData)
> values(?, ?);
> 
> status = sqlite3_prepare_v2(db, myString.c_str(), -1,
> &statement, NULL);
> 
> void *blob = reinterpretcast<char *>(imageArray);
> 

This should be:

void *blob = reinterpretcast<void *>(imageArray);

> status = sqlite3_bind_blob(statement, 2, blob, 10 *
> sizeof(unsigned short), SQLITE_STATIC);
> 
> statusu = sqlite3_finalize(statement);
> 

You need to execute the insert statement before you finalize it. You 
have created and destroyed the statement, but have not executed it. Add 
the following between the two statements above:

status = sqlite3_step(statement);
if (status != SQLITE_OK) {
     //process error
}


> 
> however when i do:
> 
> select * from Images;
> 

To dump the blob data in a human readable format you could use the hex() 
SQL function. It will display each byte of the blob as two ASCII 
characters that correspond to the hexadecimal value of the byte.

select imageID, hex(imageData) from Images;

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

Reply via email to