title: Recursive function in PL/SQL ORACLE
body: <p>In which scenario recursion can be used in PL/SQL</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION factorial (
    n POSITIVE
  ) RETURN POSITIVE
  IS
  BEGIN
    IF n = 1 THEN
      RETURN n;
    ELSE
    RETURN n * factorial(n-1);
    END IF;
  END;
  BEGIN
    FOR i IN 1..5 LOOP
      DBMS_OUTPUT.PUT_LINE(i || '! = ' || factorial(i));
    END LOOP;
  END;
  </code></pre>
  
  <p>This will work but I want to know in real world when recursion is required in data base queries  </p>