I'm trying to execute multiple sqlite statements at the same time back to back but am having a problem. Using MS SQL daily at my full time gig its fairly easy to wrap begin/end statements around inserts, deletes and updates.
I read up on the sqllite site that they support BEGIN and END transactions but whenever i pass more than one statement into sqlite3_prepare_v2 it returns an error.
example: "BEGIN Delete col1 From table1 END BEGIN Update Table2 Set col1=3 END"
I'm processing several thousand rows at a time and am trying to speed things up as much as possible.
Any thoughts?
Thanks John
__________________
---------------------------------------------------------------------- I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
I think adding semicolons after each statement will work.. still need to test.
John
__________________
---------------------------------------------------------------------- I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
There is no need for any Prepare statements if you do simple transactions (without BLOBs). You can use exclusively sqlite3_exec, and construct the inner loop statement on the fly with sprintf and a buffer variable that is large enough to hold the statement.
Hi - I'm a beginner programmer and was hoping someone would be able to tell me where I need to put the 'begin' and 'commit' statements. I have a process which takes an sql statement and puts it into this method as the 'sqlString'. Running the method succesfully runs the sql scripts as per my logging but I don't think the data is being committed to the sqlite db as the view isn't updated.
Could someone tell me where in this code I should put the begin and commit statements? THANKS!