Hello out there,

I've 2 tables


CREATE TABLE IF NOT EXISTS a(
first   INTEGER,
second  INTEGER
);

CREATE TABLE IF NOT EXISTS b(
first   INTEGER,
second  INTEGER,
PRIMARY KEY (first,second)
);

-- and INSERT data in table a


INSERT INTO a(first,second) VALUES(1,2);
INSERT INTO a(first,second) VALUES(1,2);


/* the following actions should be

1. INSERT

2. DELETE everything in table a if the INSERT worked fine

*/

INSERT INTO b(first,second)
SELECT first,second
FROM a;

DELETE
FROM a;


I already tried to solve my problem this way but it seems that I don't 
understand the concept of transactions because it doesn't stop the whole thing 
after the failed INSERT:

BEGIN TRANSACTION;
INSERT INTO b(first,second)
SELECT first,second
FROM a;

DELETE
FROM a;
COMMIT;

Thanks for your time
Oliver
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to