以下は私のコードです。何が間違っているのかわかりません。どんな助けでも大歓迎です
CREATE OR REPLACE
PROCEDURE COMP_LATE_FEE(LATE_APT_FINE IN NUMBER, LATE_GRG_FINE IN NUMBER)
AS
DIFF NUMBER;
TYPE MBCUR IS REF CURSOR RETURN MONTHLY_BILL%ROWTYPE;
MONBILL MBCUR;
MBREC MONTHLY_BILL%ROWTYPE;
BEGIN
--DIFF := FLOOR(SYSDATE - (TRUNC(SYSDATE,'MM')));
--DBMS_OUTPUT.PUT_LINE(DIFF);
OPEN MONBILL FOR
-- checking the status of all last month's bills
SELECT * FROM MONTHLY_BILL
WHERE STATUS = 'PENDING' AND SYSDATE > ED_DT;
FETCH MONBILL INTO MBREC;
-- adding the late fee amount for any bills that are past the due date
-- due date = last day of the month
DIFF := FLOOR(ABS(MBREC.ED_DT - (TRUNC(SYSDATE,'MM'))));
UPDATE MONTHLY_BILL
SET LATE_FEE = DIFF * LATE_APT_FINE
WHERE BILL_NUM = MBREC.BILL_NUM;
-- if a garage is rented by the resident then the respective additional fee is included
IF (MBREC.GARAGE_RENT != 0) THEN
UPDATE MONTHLY_BILL
SET LATE_FEE = LATE_FEE + DIFF * LATE_GRG_FINE
WHERE BILL_NUM = MBREC.BILL_NUM;
END IF;
COMMIT;
CLOSE MONBILL;
END;
/
エラーなしでコンパイルされたプロシージャ。しかし、procを呼び出すと、次のエラーが発生します
BEGIN
COMP_LATE_FEE(70,20);
END;
/
エラーレポート:
ORA-01438: value larger than specified precision allowed for this column
ORA-06512: at "LALLURI.COMP_LATE_FEE", line 19
ORA-06512: at line 2
01438. 00000 - "value larger than specified precision allowed for this column"
*Cause: When inserting or updating records, a numeric value was entered
that exceeded the precision defined for the column.
*Action: Enter a value that complies with the numeric column's precision,
or use the MODIFY option with the ALTER TABLE command to expand
the precision.