Ooh - I didn't realize that you could do SqLite transactions like this, with 
each statement in its own db.execute statement, as opposed to grouping them all 
into one string with semicolons to seperate them.

I'm going to have to try this version, both with newObjects and with gambas. 
Thanks!

--- In [email protected], Thomas Gruber <computerhu...@...> wrote:
>
> Hello,
> no, the INSERT statement remains as it was.
> This is the idea (using your code):
> 
> db.execute("BEGIN TRANSACTION")
> Do
>   recs = File.ReadText(-3)
>   ...
>   ...
>   ...
> Loop Untile file.EOS
> db.execute("COMMIT TRANSACTION")
> 
> This may not work for 30.000 records, you may have to commit more frequently 
> than that. Then you can put a counter inside the loop, like this, to commit 
> the changes after every 1000 records written:
> 
> i = 0
> db.execute("BEGIN TRANSACTION")
> Do
>   i = i + 1
>  if i>        1000 then
>     db.execute("COMMIT TRANSACTION")
>    i = 0
>    db.execute("BEGIN TRANSACTION")
>   end if
>   recs = File.ReadText(-3)
>   ...
>   ...
>   ...
> Loop Until file.EOS
> db.execute("COMMIT TRANSACTION")
> 
> Kind regards
> Thomas


-- 
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en.

Reply via email to