Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Hello again, I've got an other question about prepare : Is it possible to make a BEGIN transaction, then prepare many statements (insert, update, delete) and then COMMIT all at once in the right order? Or should I each time make a BEGIN, prepare, COMMIT? -- View this message in context:

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Michael Steiger-2 wrote: > > You need to > prepare > bind all variables (not just one) > step > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > It works great ! Thanks

Re: [sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Roger Binns wrote: > > http://www.sqlite.org/c3ref/clear_bindings.html > > Roger > > thanks for replying, but I've tried with it (sqlite3_clear_bindings) just now and the result obtained is : 1|s||| 2 3 4 Am I using it in a wrong way? (just resplacing all sqlite3_reset by

[sqlite] Problem with sqlite3_prepare_v2?

2011-05-17 Thread StyveA
Hello everyone, I don't understand why when I use the sqlite3_prepare_v2() function, some bind_xxx, and then commit, the data stored in my database are redundant.. To be more precise, when I run my code (see below), I obtain this in my database : 1|s||| 2|s|t|| 3|s|t|y| 4|s|t|y|ve

Re: [sqlite] Insert a structure

2011-05-16 Thread StyveA
Enrico Thierbach-2 wrote: > > From my experience I would recommend you to convert your structure into > some kind text format. JSON, with the excellent and well-performing yajl > library, is usually my favorite choice here. > > /eno > > I didn't know yajl, but I'll have a look at it, it

Re: [sqlite] Insert a structure

2011-05-16 Thread StyveA
Enrico Thierbach-2 wrote: > > > On 16.05.2011, at 11:08, Christoph P.U. Kukulies wrote: > >> Am 16.05.2011 10:51, schrieb StyveA: >>> Hi all, >>> >>> I'm working on a code in C, and I would like to insert a structure into >>> a &

Re: [sqlite] Insert a structure

2011-05-16 Thread StyveA
Christoph Kukulies wrote: > > Am 16.05.2011 10:51, schrieb StyveA: > A structure in C has a size and a storage address. So technically I see > no reason, why you can't do that. Just copy > the BLOB like you do a memcpy(). > But as soon as you cross architectures (big-end

[sqlite] Insert a structure

2011-05-16 Thread StyveA
Hi all, I'm working on a code in C, and I would like to insert a structure into a table as BLOB type. Is-it possible to pass it entirely in one time? Or should I insert each parameters of my structure independently? Regards, StyveA -- View this message in context: http://old.nabble.com

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Black, Michael (IS) wrote: > > Do I understand you're still seeing a segfault? I assume you're not > seeing your "Year retrieved..." statement? > > You haven't showed us your table definition. > > Change your strcmp to strcasecmp and see if that fixes it for you. > > Michael D. Black > >

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Igor Tandetnik wrote: > > Prepare doesn't touch the database in any way. It just parses the text of > the statement, and prepares execution plan. Step is where the real work is > done. > > You need to issue BEGIN statement if you want to start an explicit > transaction (and then COMMIT or END

Re: [sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Igor Tandetnik wrote: > > StyveA <styve.at...@technicolor.com> wrote: >> I'm a newbie using sqlite3, and i'm trying to save in a database some >> blob >> datas (just string and integer), >> but I can't get my data back.. I just obtain a segfault.. >>

[sqlite] Blob newbie problem

2011-05-12 Thread StyveA
Hello, I'm a newbie using sqlite3, and i'm trying to save in a database some blob datas (just string and integer), but I can't get my data back.. I just obtain a segfault.. I have searched in forums, but did'nt find anything that could help me.. Here is my code :