On Thu, 2005-07-14 at 20:24 +0200, Dirk Jagdmann wrote:
> > Is there a way to delete all rows in a table without SQLITE generating
> > temporary journal files?
> 
> If you want to delete everything maybe a simple
> 
> drop table foo;
> create table foo;
> 
> will do it.
> 

SQLite already implements the "TRUNCATE" optimization.
If you just say:

     DELETE FROM foo;

What it does internally is nearly the equivalent of
dropping and recreating the table.

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
it.
-- 
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to