sql - How can I create a trigger in sqlite database? -
i have create trigger in sqlite database.
there 3 tables in database
questions (question_id)
options (option_id, question_id)
answers (answer_id, question_id)
whenever row deleted question
table, corresponding data should deleted option
, answer
tables.
i trying create trigger using
create trigger question_delete before delete on questions each row begin delete options question_id= old.question_id , delete answers question_id= old.question_id; end
i error. should create 2 different trigger perform operation or changes required in above statement?
please let me know.
thanks nidhi
remove and
after first delete
statement:
delete options question_id = old.question_id; delete answers question_id = old.question_id;
Comments
Post a Comment