1
我想創建一個觸發器,刪除刪除其所有文章內容後的文章。我得到一個1064 error at line 5
。刪除觸發器中第5行的PL/SQL 1064錯誤
這裏是PL/SQL我已經寫:
delimiter |
create trigger `cleanup_article` after delete on `article_content`
for each row
begin
declare x int;
set x = select count(*) as x from `article_content` where id = old.id;
if x = 0 then
delete from `article` where id=old.id;
end if;
end |
delimiter ;