Thanks much - one more question though... I'm attempting to copy data from an in memory database to another db (file or otherwise). Is it possible to attach an existing in-memory database to another existing db connection? (attach database :MEMORY: would just seem to create another in mem db).
I'm trying to do this in hopes of being able to use the destination dbs existing connection - otherwise i have to do a lock/unlock close/open on the destination db - which i'd like to avoid. Thanks ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag ---- On Wed, 6 Apr 2005, Jay ([EMAIL PROTECTED]) wrote: > > -- de f <[EMAIL PROTECTED]> wrote: > > Thanks Jay. > > > > Great! This could work... > > > > I'm wondering, though if you know whether the limitation below > > (from sqlite documentation) could be safely circumvented if > > attaching the source db with an alias name. It seems to work > > when i try it but I'm concerned that there might be other > > unknown issues. > > > > "You cannot create a new table with the same name as a table in > > an attached database, but you can attach a database which > > contains tables whose names are duplicates of tables in the main > > database. It is also permissible to attach the same database > > file multiple times." > > I wrote a c++ replicator for my own database. I did this: > > open db1; > > SELECT sql FROM sqlite_master WHERE type = 'table' AND name = > 'yourtable'; > > open db2; > > execute sql from step 2 against db2 to create a duplicate blank table; > > close db2; > > attatch db2 to db1; > > insert into db2.yourtable > select * from db1.yourtable; > > close all; > > > > --------------------------------- > > You a Gamer? If you're near Kansas City, ask me about the Recruits and Conquest conventions. > --------------------------------- > > The Castles of Dereth Calendar: a tour of the art and architecture of Asheron's Call > http://www.lulu.com/content/77264 > > > > __________________________________ > Yahoo! Messenger > Show us what our next emoticon should look like. Join the fun. > http://www.advision.webevents.yahoo.com/emoticontest > >