Re: [sqlite] Data deleted
Thanks again, I will have a go at that On 10/08/2011 13:53, Simon Slavin wrote: > > On 10 Aug 2011, at 1:39pm, Malcolm Lander wrote: > >> Thanks for that. Although that disables the DDL trigger, on running the >> import I get a abort due to constraint violation error: > > You will probably need to import data into the TABLEs in an order that suits > the data hierarchy. For instance, the TRIGGER you deleted implies that you > will need to put data into the Aircraft TABLE before the Flight TABLE. I > don't know what other tables you have, but similar logic might apply to those > too. > > Simon. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Data deleted
On 10 Aug 2011, at 1:39pm, Malcolm Lander wrote: > Thanks for that. Although that disables the DDL trigger, on running the > import I get a abort due to constraint violation error: You will probably need to import data into the TABLEs in an order that suits the data hierarchy. For instance, the TRIGGER you deleted implies that you will need to put data into the Aircraft TABLE before the Flight TABLE. I don't know what other tables you have, but similar logic might apply to those too. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Data deleted
Thanks for that. Although that disables the DDL trigger, on running the import I get a abort due to constraint violation error: Exception: - 2.1 Date : Wed, 10 Aug 2011 13:35:56 +0100 2.2 Address : 00A13665 2.3 Module Name : SQLiteExpertPro.exe - (The complete administration tool for SQLite) 2.4 Module Version: 3.3.33.2174 2.5 Type : ESQLiteException 2.6 Message : Abort due to constraint violation. 2.7 ID: 36A3 2.8 Count : 1 2.9 Status: New 2.10 Note : On 10/08/2011 13:29, Simon Slavin wrote: > > On 10 Aug 2011, at 1:27pm, Malcolm Lander wrote: > >> Thanks for the reply. It looks like this in the DDL is the culprit: >> >> CREATE TRIGGER [AircraftIDdeltrig] >> BEFORE DELETE >> ON [Aircraft] >> FOR EACH ROW >> BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END; >> >> Is there a way to disable it? > > Issue the SQLite command > > DROP TRIGGER AircraftIDdeltrig > > Once you've done your import, to restore functionality, reissue the 'CREATE > TRIGGER' command as shown above. > > Simon. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Data deleted
On 10 Aug 2011, at 1:27pm, Malcolm Lander wrote: > Thanks for the reply. It looks like this in the DDL is the culprit: > > CREATE TRIGGER [AircraftIDdeltrig] > BEFORE DELETE > ON [Aircraft] > FOR EACH ROW > BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END; > > Is there a way to disable it? Issue the SQLite command DROP TRIGGER AircraftIDdeltrig Once you've done your import, to restore functionality, reissue the 'CREATE TRIGGER' command as shown above. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Data deleted
Thanks for the reply. It looks like this in the DDL is the culprit: CREATE TRIGGER [AircraftIDdeltrig] BEFORE DELETE ON [Aircraft] FOR EACH ROW BEGIN DELETE FROM Flights WHERE AircraftID = OLD.AircraftID;END; Is there a way to disable it? On 10/08/2011 13:14, Igor Tandetnik wrote: > Malcolm Landerwrote: >> I have just tried using SQLite pro. In the existing database I am >> trying to manipulate there are several tables. On trying to import a >> .csv file into one of them and replacing the current data in that table >> it works OK. >> >> However, all the data in one of the other tables also gets deleted >> during the operation. Why is this? > > There's either a trigger doing the deletion, or a foreign key with ON DELETE > CASCADE clause. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Data deleted
Malcolm Landerwrote: > I have just tried using SQLite pro. In the existing database I am > trying to manipulate there are several tables. On trying to import a > .csv file into one of them and replacing the current data in that table > it works OK. > > However, all the data in one of the other tables also gets deleted > during the operation. Why is this? There's either a trigger doing the deletion, or a foreign key with ON DELETE CASCADE clause. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users