Try:

attach database ":memory:" as m;

Then:

create table m.table as select * from table;

For each of your tables.

Shawn M. Downey
MPR Associates
10 Maxwell Drive, Suite 204
Clifton Park, NY 12065
518-371-3983 x113 (work)
860-508-5015 (cell)
 

-----Original Message-----
From: Jay Sprenkle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 26, 2006 3:23 PM
To: sqlite-users@sqlite.org; [EMAIL PROTECTED]
Subject: Re: [sqlite] Re: Re: Copy tables from one memory database to
another with no disk access?

> 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
> .

You could copy the table contents (not row at a time) with

insert into db2.table_blah
  select * from db1.table_blah

( I'm pretty sure that syntax works in sqlite )

The sql to create the destination table is in a column in the sql master
table.
You might be able to use that to create the destination tables
dynamically.

Reply via email to