CREATE OR REPLACE procedure BEFOR_VIP_RESET.CP_UPDATE_DTL_YHJ_SUM
is
cursor cur IS SELECT TRIM(DC.INV_NUM) INV_NUM ,SUM(DC.REDEEMVALUE) SUM_REDEEMVALUES FROM DINV_COUPON DC GROUP BY DC.INV_NUM;
INT_COUNT_DINV_COUPON_BY_INV number;
begin
for RUR1 in cur LOOP
BEGIN
SELECT COUNT(*) INTO INT_COUNT_DINV_COUPON_BY_INV FROM DINV_DTL_YHJ DDY WHERE TRIM(DDY.INV_NUM) =TRIM(RUR1.INV_NUM);
IF (INT_COUNT_DINV_COUPON_BY_INV !=0) THEN
UPDATE DINV_DTL_YHJ D_D_Y SET D_D_Y.REDEEMWAY = (RUR1.SUM_REDEEMVALUES/INT_COUNT_DINV_COUPON_BY_INV);
ORA-06550
PLS-00103:出现符号"END"在需要下列之一时:
:=.(@;
符号":"被替换为"END"后继续。
END IF ;
END;
END LOOP;
end CP_UPDATE_DTL_YHJ_SUM;