I have below function in oracle,
create or replace FUNCTION CALINTEREST
( DNumber IN VARCHAR2,
IRate IN NUMBER
) RETURN NUMBER IS
AInterest NUMERIC(17,8):=0;
PDue NUMERIC(11,2);
IDue NUMERIC(17,8);
INTRate NUMERIC(5,2);
IntDate DATE;
IntDATEDIFF NUMERIC(6):=0;
BEGIN
BEGIN
SELECT
DBRD_PRI_DUE,
DBRD_INT_DUE,
DBRD_INT_RATE,
DBRD_INT_DATE INTO
PDue
,IDue
,INTRate
,IntDate
FROM
DBRD
WHERE
DBRNO = DNumber;
IF(INTRate = 999)
THEN
INTRate := IRate;
END IF;
IntDATEDIFF:=Cast((Sysdate-IntDate) AS NUMBER(11,0));
AInterest := IDue + (PDue * INTRate * IntDATEDIFF / 365 / 100);
END;
RETURN AInterest;
END;
I am getting below two error, Error(31,64): PLS-00103: Encountered the symbol "(" when expecting one of the following: . ) @ % The symbol ")" was substituted for "(" to continue. Error(31,70): PLS-00103: Encountered the symbol ")" when expecting one of the following: . ( * % & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset The symbol "(" was substituted for ")" to continue.
Cast((Sysdate-IntDate) AS NUMBER(11,0));
should beCast((Sysdate-IntDate) AS NUMBER);
– GriffeyDog