Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
hey i wanted to thank Igor, Ron, Dennis and Matthew (sorry if i forgot anyone else) with helping me with this blob stuff. -cheers c.s. --- Igor Tandetnik <[EMAIL PROTECTED]> wrote: > C S <[EMAIL PROTECTED]> wrote: > > -so it seems that despite my byte order being > wrong?, > > i get the output

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Igor Tandetnik
C S <[EMAIL PROTECTED]> wrote: > -so it seems that despite my byte order being wrong?, > i get the output back out exactly how i stored it in > the original array. There is nothing wrong with the byte order. It matches the native order of your CPU. > is there a problem here i should > be

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
ngineer III, Tyco > Electronics, 434.455.6453 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of C S > Sent: Wednesday, March 12, 2008 12:07 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SQL Blobs - what a

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
Igor, haha i JUST changed this before i checked your email to: while ((status = sqlite3_step(statement)) == SQLITE_ROW) { std::cout << "status is: " << status << std::endl; i++; if(i == 1) std::cout << "first row" << std::endl; else

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Igor Tandetnik
C S <[EMAIL PROTECTED]> wrote: > thanks for all your help too man. here is what is in > the table images so far when i do a select. its 3 > blobs: > > sqlite> select imageID, hex(imageData) from Images; > 1|00 0003 0006 0009 000C 000F 0012 0015 0018 001B 00 > 2|00 0001 0002 0003 0004 0005 0006

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Wilson, Ron P
ral Discussion of SQLite Database Subject: Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside) Igor, thanks for all your help too man. here is what is in the table images so far when i do a select. its 3 blobs: sqlite> select imageID, hex(imageData) from Images; 1|00 0003 000

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
replying to my own message - update should my myString2 - that is not an actual error, just copied and pasted it wrong. also i noticed a problem with i in my final for loop. i changed it to j since i was being incremented. i still get the same output however. just to clarify. --- C S <[EMAIL

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
Igor, thanks for all your help too man. here is what is in the table images so far when i do a select. its 3 blobs: sqlite> select imageID, hex(imageData) from Images; 1|00 0003 0006 0009 000C 000F 0012 0015 0018 001B 00 2|00 0001 0002 0003 0004 0005 0006 0007 0008 0009 00 3|00 0001 0002 0003

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Wilson, Ron P
To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside) 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

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Igor Tandetnik
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

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
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,

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
replying to my own message - i added the step function that i needed...so: sqlite_step(statement), in between the bind and finalize.. i deleted all the entries from the table so i could start over, so when i do a select on Images i get: 1| so either somehow i cant see the contents of the blob

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Dennis Cote
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 =

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Igor Tandetnik
C S <[EMAIL PROTECTED]> wrote: > myString = "insert into Images(imageID, imageData) > values(?, ?); > > status = sqlite3_prepare_v2(db, myString.c_str(), -1, > , NULL); > > void *blob = reinterpretcast(imageArray); > > status = sqlite3_bind_blob(statement, 2, blob, 10 * > sizeof(unsigned short),

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
Dennis mentioned before that it was not necessary to do a bind on something that was defined as an integer primary key. when i do: select * from Images; 1| 2| thats pretty much it. there are two entries because i tried to pure void cast as the previous message suggest vs the char * way..and

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Matthew L. Creech
On Wed, Mar 12, 2008 at 9:37 AM, C S <[EMAIL PROTECTED]> wrote: > > myString = "insert into Images(imageID, imageData) > values(?, ?); > > > status = sqlite3_prepare_v2(db, myString.c_str(), -1, > , NULL); > > void *blob = reinterpretcast(imageArray); > > > status =

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Wilson, Ron P
To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside) Dennis, thanks for your and everyone elses help with this problem. i actually did everything you said here and the program executed without any errors. i re-created the table to what you

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread C S
Dennis, thanks for your and everyone elses help with this problem. i actually did everything you said here and the program executed without any errors. i re-created the table to what you said as now so it is blob now instead of text. i get nothing. i have a printout statement to make sure

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-11 Thread Dennis Cote
C S wrote: > hi all - i am trying once again to insert an image(an > array of shorts) into a blob. > > i created a table that is described as such: > > CREATE TABLE Images{ > imageID integer primary key, > imageData text not null); > > #1 - is text ok here for a blob? maybe not - this may > be

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-11 Thread Igor Tandetnik
C S <[EMAIL PROTECTED]> wrote: > so here is what i am doing in the code. imageArray > holds the unsigned shorts(there are 10 of them) > > char* blob = reinterpret_cast(imageArray); > > string myString = "insert into Images(ImageID, > imageData) values(?, 'blob')"; This statement inserts