On Wed, Apr 7, 2010 at 6:57 PM, Nicolas Williams
<[email protected]> wrote:
> sqlite> CREATE TABLE foo(id INTEGER PRIMARY KEY, a, b, c);
> sqlite> insert into foo values(1, 'a', 'b', 'c');
> sqlite> select * from foo;
> 1|a|b|c
> sqlite> CREATE TEMP TABLE tempfoo AS SELECT * FROM foo WHERE id = 1;
> sqlite> UPDATE tempfoo SET a = 'z';
> sqlite> INSERT OR REPLACE INTO foo SELECT * FROM tempfoo;
> sqlite> SELECT * FROM foo;
> 1|z|b|c
> sqlite>
>
> The trick is CREATE TEMP TABLE ... AS SELECT * FROM ... WHERE ...
> followed by INSERT OR REPLACE INTO ... SELECT * FROM <temp table>.


Well, my problem is that INSERT OR REPLACE INTO is not working because
of (possibly) FTS3. By the way, REPLACE is an alias for INSERT OR
REPLACE.

This is where I wish I had a way to temporarily disable TRIGGERs, via a pragma.

There has to be some other way of copying the contents of one row into
another... a straight-ahead update, not an insert.





-- 
Puneet Kishor
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to