Igor Tandetnik wrote:

Randy Graham wrote:

Igor Tandetnik wrote:

Randy Graham
<[EMAIL PROTECTED]>
wrote:

Is it possible to copy tables from one memory database to another
without going through an intermediate disk database?



Can't you just write a function that would run "select * from table"
on one db, and for each record build and execute an insert statement
on the other? Using a parameterized prepared statement of course.

No, because inserting, say 50,000 records into my file db from  my mem
db can take 5 minutes or more, even with transactions since my disk
flash is so slow. This would make my mem db unavailable for incoming
queries/updates during this time which is unacceptable.


I'm not sure I follow. Didn't you ask how to copy from one memory db into another memory db? Where does the file db come into the picture?

Igor Tandetnik


Sorry, I misunderstood you. Yes, selecting from one mem db and inserting to another mem db would do the copy. I'd thought of this, but wanted to avoid having to iterate through all the rows and having explicit insert statements for each table, which would require knowledge of the schema for each table
.
I was hoping for a generic copy solution for mem db->mem db as elegant as the solution for mem db ->file db (using create table .. as select * from ...).

It sure would be nice to be able to attach one mem db to another.

-Randy





Reply via email to