Oralce PL/SQL examples of recursion (#91)

This commit is contained in:
Timur Tarasenko
2018-10-18 10:27:58 -05:00
committed by Aditya Bhargava
parent 31412a0b96
commit ac08df2ee7
3 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
SET SERVEROUTPUT ON
DECLARE
result NUMBER;
FUNCTION countdown(x NUMBER)
RETURN NUMBER
IS
f NUMBER;
BEGIN
dbms_output.put_line(x);
IF x <= 0 THEN
return x;
ELSE
f := countdown(x - 1);
END IF;
RETURN f;
END;
BEGIN
result := countdown(5);
END;