Juzbrig <[EMAIL PROTECTED]> wrote:
> I want to make simple trigger.
> I have table 'genre' and 'artist', 'artist' have foreign key
> 'genre_id' which is the primary key in 'genre' table
> I want the trigger to delete artist wchich have the same foreign key
> as the deleted genre for example:
> "delete from artist where genre_id = '10'" is triggered when "delete
> from genre where genre_id = '10'" is call.
>
> here is the form to fill :
>
> CREATE TRIGGER delete_artist
> BEFORE DELETE
> ON genre
> BEGIN
> /* Insert trigger body here */
>
>
> END;
BEGIN
delete from artist where genre_id=old.genre_id;
END;
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users