I have 2 different database 'A' and 'B'.I need to create a trigger that when I would insert any entry in table 'T1' of database 'A' then entries of table 'T2' of database 'B' would gets deleted.
Kindly suggest me a way!!
This is not possible.
Hence, (only) the following is possible:
For A.sqlite:
create table T1(id integer primary key);
For B.sqlite:
create table T2(id integer primary key);
attach 'A.sqlite' as A;
create temporary trigger T1_del after delete on A.T1
begin
delete from T2 where id = OLD.id;
end;
But that would only propagate deletes from T1 to T2 within the connection that declared the temporary trigger. If you opened A.sqlite separately, the trigger would not be there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With