DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Implementing recursion inOracle

  1. #1
    Join Date
    Nov 2001
    Posts
    1
    I'd want to know wether there's an Oracle version that includes recursion process.

  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    I'm not sure I understand the question, but here goes...

    Recursion is simply when a piece of code calls itself. In SQL, this is not possible. In PL/SQL, it is no different than any other language.

    CREATE OR REPLACE PROCEDURE fred(x IN OUT NUMBER) AS
    BEGIN
    IF (X < 40) THEN
    X := X * 2;
    fred(x);
    END IF;
    END;

    This is just out of my head, meaningless, and may not compile or run, but you get the idea. Simply by calling yourself, you are now doing recursion. Nothing special about it.

    - Chris
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width