Re: [sqlite] Copy tables from one memory database to another with no disk access?

2006-01-27 Thread Randy Graham
Christian Smith wrote: On Wed, 25 Jan 2006, Randy Graham wrote: Hello, Is it possible to copy tables from one memory database to another without going through an intermediate disk database? No, but you can copy the tables to be backed up to a temporary table, then backup up

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Jay Sprenkle wrote: 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

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Gerry Snyder wrote: Randy Graham wrote: It sure would be nice to be able to attach one mem db to another. -Randy Didn't Jay Sprenkle's code do what you wanted? Jay Sprenkle wrote: sqlite> create table x(y text); sqlite> insert into x(y) values('one'); sqlite> select * fr

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
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 &

Re: [sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
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 e

Re: [sqlite] Re: Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Igor Tandetnik wrote: Jay Sprenkle wrote: Every time you open a :memory: database you get a separate instance, identified only by its sqlite3* handle. I'm not sure if ATTACH would work with :memory:, but even if it does it would just create a new, empty in-memory database, not refer to the

[sqlite] Copy tables from one memory database to another with no disk access?

2006-01-25 Thread Randy Graham
Hello, Is it possible to copy tables from one memory database to another without going through an intermediate disk database? Thanks, -Randy

RE: [sqlite] How to delete all rows in table (TRUNCATE) without creating journal file(s)?

2005-07-14 Thread Randy Graham
Thanks Dirk. Yes, that would work. Since I already have my tables logically spread across several files, I think I'll just keep and empty db file 'templates' handy, delete the files containing the tables I want cleared, and copy the templates to my working db files. Thanks for the suggestion.

RE: [sqlite] How to delete all rows in table (TRUNCATE) withoutcreating journal file(s)?

2005-07-14 Thread Randy Graham
[D. Richard Hipp wrote:] >But that gives me an idea. If you need to delete an >entire table quickly, why not put that one table in a >separate database and ATTACH it. Then when you want >to erase it all, DETACH the separate database, delete >the file, then reinitialize the database and re-ATTACH

RE: [sqlite] How to delete all rows in table (TRUNCATE) withoutcreating journal file(s)?

2005-07-14 Thread Randy Graham
Wow, thanks for such a quick response ! >Disabling the journal would roughly half the amount >of disk (flash) I/O required. If it currently takes >2 minutes to delete, disabling the journal would >reduce that to about 1 minutes. Still a long time. Ok, thanks, that's good to know. >Do you also

[sqlite] How to delete all rows in table (TRUNCATE) without creating journal file(s)?

2005-07-14 Thread Randy Graham
Hello, Is there a way to delete all rows in a table without SQLITE generating temporary journal files? I'm using SQLITE in an embedded system with a *very* slow flash disk and journal file creation for some operations (ie. deleting 1000s of rows from a table) is killing performance. When I

[sqlite] Copying file tables to in memory tables with indices.

2005-05-20 Thread Randy Graham
Hello, I'm using in memory tables that are copies of file tables. I create the in memory tables by opening an in memory database, and attaching a file database to it. I then copy the table to my in memory database using something like "create table t_mem as select * from t_file". This gets the