Dennis, 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 but that looks to be ok. 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? somehow though i would think that i would need the number of blob entries in the database to make this work. for(int i = 0; i < blob_entries; i++) { numBytes = sqlite3_column_bytes(statement, i); sqlite3_column_blob(statement, i); } --what do you think? thanks all for the help. its appreciated. --- Dennis Cote <[EMAIL PROTECTED]> wrote: > 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 > ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users