You should write all your records inside a transaction, instead of 4
minutes time should be about just a couple of seconds.
Your code should looks like:
rs = memdb.SQLSelect("SELECT * ...")
db.SQLExecute("BEGIN TRANSACTION")
While Not rs.eof
db.SQLExecute("INSERT INTO ...")
Wend
db.Commit
---
Marco Bambini
http://www.sqlabs.net
http://www.sqlabs.net/blog/
On Feb 14, 2006, at 8:08 AM, Jeff Ayling wrote:
Hi all,
I've got a curly one here.
What is the fastest way to save an in-memory db to the hd?
So, I've got an in-memory db but on quit I want to save the db so
it can be imported back into memory on next startup.
Currently I'm creating a new file based db and doing a select * and
While Not rs.eof/wend'ing my way through each table to save it to
the hd - but it takes tooo long. 4 minutes to save a db with 45000
records.
I'd love to put the challenge out there to find the fastest way to
turn an in-memory RealSQLDatabase in RB2006r1 into a db on the hd
which can then be imported later.
Maybe the way I'm doing it is the only way - but I doubt it :-)
Cheers
Jeff
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>