postgres 에서 아래와 같은 trigger를 등록해서 사용하고 있는데요.. 오라클로 어떻게 변경하는지.
간단하게 t_member 테이블의 member_id를 삭제하면 연관된 테이블(t_member_auth, t_member_extnum, t_member_phone) 테이블도 삭제하는
내용입니다.
부탁드립니다.
CREATE OR REPLACE FUNCTION prc_delete_member() RETURNS TRIGGER AS
$t_member$
BEGIN
DELETE FROM t_member_auth WHERE member_id = OLD.member_id;
DELETE FROM t_member_extnum WHERE member_id = OLD.member_id;
DELETE FROM t_member_phone WHERE member_id = OLD.member_id;
RETURN OLD;
END;
$t_member$
LANGUAGE plpgsql;
CREATE TRIGGER tgr_delete_member BEFORE DELETE
ON t_member FOR EACH ROW
|