Re: [sqlite] SQLite Manager Firefox extension
It is pretty, runs well and is easy to use. Better than "decent". P Kishor wrote: To all those looking for a decent, cross-platform SQLite gui, check out SQLite Manager Firefox add-on https://addons.mozilla.org/en-US/firefox/addon/5817 I have just started experimenting with it, and it really quite nice even at version 0.2.9.1. Works well on my Mac. -- Puneet Kishor - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] commit and rollback
Why not just test the status returned by sqlite3_step? Use sqlite3_prepare_v2 to make the returned status give more information. When you get an error just finalize your COMMIT statement and move your pointer from the prepared COMMIT statement to a ROLLBACK and shortcut the transaction. Instead of committing you will rollback. arbalest06 wrote: good day! i think its really a good solution to this problem. However, im required to implement the c apis of sqlite..so i need to use the sqlite3_commit_hook and sqlite3_rollback_hook..im doing some prototyping to see their functionalities but i really cant make it work..and i also cant find some C sample source code using these apis..if it is possible, can someone post some c code using these apis?.. thank you and more power! God bless!.. John Stanton-3 wrote: All you need to do is to test the returned status of your sqlite3_step calls and if you get an error launch an SQL statement "ROLLBACK" and bail out of the transaction. If there are no errors you complete your transaction with an SQL "COMMIT". sqlite_prepare_v2 SQL statements exec BEGIN count = 0; while ((count < MAX) && !error) { rc = sqlite3_step SQL statement[count++]; if (rc != SQLITE_OK) { error = TRUE; } } if (error) exec ROLLBACK else exec COMMIT d_maniger06 wrote: good day!.. i have a list of records that i want to insert in my database..if ever an error occurred ( e.g. insert was not successful ), i want to undo all the previous inserts that i have done..to do this, i have read that i would need to use sqlite3_commit_hook and sqlite3_rollback_hook..i have read their descriptions in the sqlite site, but i really can't understand it..im just a newbie in sqlite by the way..i also have tried searching sample c codes that does these things but i really cant find any.. i would just like to request a simple sample code demonstrating on how to use these two apis..if it is ok also, please leave a very brief explanation on what happened in the code.. thank you and God bless!.. :working: - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] commit and rollback
On 11/26/07, arbalest06 <[EMAIL PROTECTED]> wrote: > John Stanton-3 wrote: > > All you need to do is to test the returned status of your sqlite3_step > > calls and if you get an error launch an SQL statement "ROLLBACK" and > > bail out of the transaction. If there are no errors you complete your > > transaction with an SQL "COMMIT". > i think its really a good solution to this problem. However, im required to > implement the c apis of sqlite..so i need to use the sqlite3_commit_hook and > sqlite3_rollback_hook..im doing some prototyping to see their > functionalities but i really cant make it work..and i also cant find some C > sample source code using these apis..if it is possible, can someone post > some c code using these apis?.. SQL *is* part of the API of SQLite. There is no separate C API to implement transactions; they are part of SQL. The commit and rollback hooks are called when someone uses the relevant SQL statements. They cannot be used to do what you have described, a transactional batch insert. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] commit and rollback
good day! i think its really a good solution to this problem. However, im required to implement the c apis of sqlite..so i need to use the sqlite3_commit_hook and sqlite3_rollback_hook..im doing some prototyping to see their functionalities but i really cant make it work..and i also cant find some C sample source code using these apis..if it is possible, can someone post some c code using these apis?.. thank you and more power! God bless!.. John Stanton-3 wrote: > > All you need to do is to test the returned status of your sqlite3_step > calls and if you get an error launch an SQL statement "ROLLBACK" and > bail out of the transaction. If there are no errors you complete your > transaction with an SQL "COMMIT". > > sqlite_prepare_v2 SQL statements > > exec BEGIN > > count = 0; > while ((count < MAX) && !error) { > rc = sqlite3_step SQL statement[count++]; > if (rc != SQLITE_OK) { > error = TRUE; > } > } > if (error) exec ROLLBACK > else exec COMMIT > > d_maniger06 wrote: >> good day!.. >> >> i have a list of records that i want to insert in my database..if ever an >> error occurred ( e.g. insert was not successful ), i want to undo all the >> previous inserts that i have done..to do this, i have read that i would >> need >> to use sqlite3_commit_hook and sqlite3_rollback_hook..i have read their >> descriptions in the sqlite site, but i really can't understand it..im >> just a >> newbie in sqlite by the way..i also have tried searching sample c codes >> that >> does these things but i really cant find any.. >> >> i would just like to request a simple sample code demonstrating on how to >> use these two apis..if it is ok also, please leave a very brief >> explanation >> on what happened in the code.. >> >> thank you and God bless!.. :working: > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > > -- View this message in context: http://www.nabble.com/commit-and-rollback-tf4804976.html#a13963043 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: Nonexistant Delimiters?
Argh, I feel like an idiot. I had my SQL syntax wrong because I messed up some delimiters. Now that I have that straightened out, it works fine. I think this will make separating strings a lot easier for me. Andrew On Nov 26, 2007 7:32 PM, Andrew Wiley <[EMAIL PROTECTED]> wrote: > I'm havinga large bit of encoding confusion. I'm programming an app in > Java that is using SQLite, and have a text field that will contain a > variable number of entries. I of course wanted to separate those > entries with delimiters, but I thought I could avoid the hassle of > making sure that user inputted characters weren't delimiters by using > characters that "don't exist" as delimiters. In Java, the character > values below the decimal value 33 represent nothing, so I just took an > arbitrary number (2, in this case), stored it as a character, and > tried to put it in the database. > I got an unrecognized token error. The thing I don't understand here > is that the value 2 is a perfectly valid character value, it just > doesn't map to a character. Why couldn't I store it in the database? > Is it something involving the interface, or is SQLite storing > characters in such a way that this sort of thing isn's supported? > I know Java uses unicode, and my database is using UTF-8 (which I can, > I think, fairly safely assume Java is using when they say "unicode"), > so the character should be stored in the same format in SQLite as in > Java. > > Am I completely wrong here (I half expect it), or is there a way to do > something along these lines? > - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] SQLite Manager Firefox extension
To all those looking for a decent, cross-platform SQLite gui, check out SQLite Manager Firefox add-on https://addons.mozilla.org/en-US/firefox/addon/5817 I have just started experimenting with it, and it really quite nice even at version 0.2.9.1. Works well on my Mac. -- Puneet Kishor - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite with C++
Am Mon, 26 Nov 2007 08:36:47 -0500 (EST) schrieb Clay Dowling: > > Andreas Volz wrote: > > Am Sun, 25 Nov 2007 12:11:50 +0100 schrieb Andreas Volz: > > > >> Hello, > >> > >> I used this minimal example code to test my sqlite connection. This > >> works without problems. But now I tried to move the 'db' variable > >> into the private member section of my 'Cache' class to access it > >> from various member functions. That's all. I would assume that > >> this makes no difference. But my app crash at sqlite3_open() > > > > Seems as it was a strange memory bug here. Forget my question. > > Andreas, > > While there might be a strange memory bug going on, the bigger issue > is that if you have a db member of the Cache class, you're declaring > a local db variable that's masking the member. That could be leading > to unexpected results later on if you're expecting to use it. This was only example code. I commented that out in if I use it as member variable. But I found the bug. It was because of wrong initialization of a global variable and crashed because of side effects. regards Andreas - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Running SQLite tests
Hi- Is there any documentation on how one would run the SQLite tests? I'm thinking it would be an excellent test for my particular platform port. I'm seeing the test directory in CVS, but not exactly sure what to do with the test files. Thanks, Mark - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] SQLite 3.5.2 - Unix - Memory issue?
Ah, yes. My mistake. Thanks. > > The locking style has absolutely nothing to do with > threads. Locking style is what kind of file locks > are used to prevent separate processes from updating > the same database as the same time. SQLite uses > posix advisory locks by default. Not all systems > support posix advisory locks correctly, which is the > reason for providing alternatives. > -- > D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite with C++
Andreas Volz wrote: > Am Sun, 25 Nov 2007 12:11:50 +0100 schrieb Andreas Volz: > >> Hello, >> >> I used this minimal example code to test my sqlite connection. This >> works without problems. But now I tried to move the 'db' variable into >> the private member section of my 'Cache' class to access it from >> various member functions. That's all. I would assume that this makes >> no difference. But my app crash at sqlite3_open() > > Seems as it was a strange memory bug here. Forget my question. Andreas, While there might be a strange memory bug going on, the bigger issue is that if you have a db member of the Cache class, you're declaring a local db variable that's masking the member. That could be leading to unexpected results later on if you're expecting to use it. Clay -- Lazarus Registration http://www.lazarusid.com/registration.shtml - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Threading (again)
SQLite is completely threadsafe. So we can share a single database connection across threads, it the underlying OS is Okay. But I guess we can not share a sqlite3_stmt prepared statement across threads threads. Am I correct. Or am I missing something? -- Sabyasachi
Re: [sqlite] sqlite icon
"Cariotoglou Mike" <[EMAIL PROTECTED]> wrote: > DRH : do you mind if I usurp the favicon.ico from the sqlite site, to > use in my application ? > thanks, mike > No. -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] sqlite icon
DRH : do you mind if I usurp the favicon.ico from the sqlite site, to use in my application ? thanks, mike - To unsubscribe, send email to [EMAIL PROTECTED] -