oracle存储过程2
DROP PROCEDURE MRR.delete_risk_assessment;
CREATE OR REPLACE PROCEDURE MRR.delete_risk_assessment (
id IN NUMERIC
) IS
BEGIN
DELETE MRR.riskassessmentvalue
WHERE risktypedetail_id IN
(
SELECT MRR.risktypedetail_id FROM risktypedetail
WHERE riskassessment_id = id
);
SAVEPOINT point1;
DELETE MRR.risktypedetail
WHERE riskassessment_id = id;
SAVEPOINT point2;
DELETE MRR.riskassessment
WHERE riskassessment_id = id;
EXCEPTION
WHEN OTHERS THEN ---若出现异常 执行回滚
ROLLBACK TO SAVEPOINT point1;
END;
/
GRANT EXECUTE ON MRR.delete_risk_assessment TO DMM_KCMRLRSK_ROLE;
/
本文出自 “坠落凡间的天使” 博客
相关新闻>>
- 发表评论
-
- 最新评论 更多>>