DECLARE
vInteger PLS_INTEGER := 3;
FUNCTION FnRecursive(pInteger IN NUMBER) RETURN NUMBER IS
vTotal NUMBER := 0;
BEGIN
vTotal := vTotal + pInteger;
IF pInteger > 0 THEN
vTotal := vTotal + FnRecursive(pInteger - 1);
END IF;
RETURN(vTotal);
END FnRecursive;
BEGIN
dbms_output.put_line(FnRecursive(vInteger));
END;
沒有留言:
張貼留言