Hey i am trying to create a trigger that will delete all the relations to a particular band_id given, The first table is bands and the second table is releases,the column with single integers is the band_id and so i need to create a trigger to delete the band_id and all its relations from both tables
1 Radiohead
2 Prodigy
3 Kylie Minogue
4 Keith Washington
5 Nick Cave
6 Robbie Williams
7 Pj Harvey
8 Catatonia
9 Manic Street Preachers
cd001 1
cd002 1
cd003 1
cd004 1
cd006 1
cd007 1
cd008 1
so far i have attempted created a trigger and have:
CREATE TRIGGER Updates
AFTER INSERT ON bands
REFERENCING new row band_id
FOR EACH row
when band_id is NOT null
DELETE FROM bands WHERE band_id = 1 ;
This should in theory delete at least from the bands table the band_id 1 however it has an error can anyone see a problem with this or give any advice?