当前位置: 动力学知识库 > 问答 > 编程问答 >

sql - Can't delete child records with trigger on Sequel Pro

问题描述:

First I want to say I've never tried using triggers before, and I read a lot of information to do this. What I want to do is delete all records from gallery_assets_meta where its parent_id is equal to gallery_assets.id.

This was what I tried on sequel pro:

My Sql code:

BEGIN

DELETE FROM gallery_assets_meta

WHERE gallery_assets_meta.parent_id = old.id;

END

When I try to delete a record from gallery_assets I get this error:

分享给朋友:
您可能感兴趣的文章:
随机阅读: