Oracle删除视图中的数据

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/wuxq0505/article/details/84356984
CREATE OR REPLACE PROCEDURE "INDI_DEL_PRO" (IDPARA IN INDIVIDUALVIEW.ID%TYPE, CATEGORYPARA IN INDIVIDUALVIEW.CATEGORY%TYPE, RETURNPARA OUT NUMBER)
AS
APPLYNO INDIVIDUALVIEW.APPLY_NO%TYPE;
BEGIN
  SELECT COUNT(*) INTO RETURNPARA FROM INDIVIDUALVIEW WHERE ID=IDPARA AND CATEGORY=CATEGORYPARA;
  SELECT APPLY_NO INTO APPLYNO FROM INDIVIDUALVIEW WHERE ID=IDPARA AND CATEGORY=CATEGORYPARA;
  IF    CATEGORYPARA= '1001'THEN
        DELETE FROM SSC_EVECT_LOAN_INFO WHERE ID=IDPARA;
        DELETE FROM SSC_DAILY_LOAN_DETAIL_INFO WHERE ID=APPLYNO;
  ELSIF CATEGORYPARA= '1002'THEN
        DELETE FROM SSC_DAILY_LOAN_INFO WHERE ID=IDPARA;
  ELSIF CATEGORYPARA= '1003'THEN
        DELETE FROM SSC_EVECT_EXPENSE_INFO WHERE ID=IDPARA;
        DELETE FROM SSC_EVECT_EXPENSE_DETAIL_INFO WHERE ID=APPLYNO;
  ELSIF CATEGORYPARA= '1004'THEN
        DELETE FROM SSC_DAILY_EXPENSE_INFO WHERE ID=IDPARA;
        DELETE FROM SSC_DAILY_LOAN_DETAIL_INFO WHERE ID=APPLYNO;
  END IF;
END;
 
 
展开阅读全文

没有更多推荐了,返回首页