Advertisement

10.29.2002 at 07:50AM PST, ID: 20385113
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Oracle Recursive procedures

Asked by chandubcs in Oracle 3rd Party Tools

Tags: , , ,

I have a small question on recursive sub programs in Oracle. I have a one procedure xx_FIRST with one parameter. In this procedure at circumstances I need to call the same procedure with different parameter value. There is a IF condition in that, like if that condition is true call yy_SECOND procedure otherwise call same procedure xx_FIRST with different parameter value. These procedures are in same package and does have couple of CURSORS, SELECT and UPDATE statements. This is something related to recursion. But I have used recursion on programming languages like C, Java...etc,. I dont know the recursion will work in Oracle database procedures or not. Does this cause any unending loop? Does it make databse server down for a while when the loop is going on? Will it affect database slow down performance?
 
  I would appreciate if anyone can help me in this issue, Thanks in advance

The sample code is looks like:

PROCEDURE xx_FIRST(
    v_id  IN  NUMBER
) IS
    v_f_sum       NUMBER := 0;

    CURSOR a_cursor IS
        SELECT  distinct ID, NAME
        FROM    EMP
        WHERE   EMP_ID = v_id;

    CURSOR b_cursor IS
        SELECT  distinct ID, NAME
        FROM    DEPT
        WHERE   EMP_ID = v_id;
BEGIN
        FOR C1 IN a_cursor LOOP
          IF ().... END IF;
     END LOOP;

        FOR C2 IN B_cursor LOOP
          IF ().... END IF;
     END LOOP;

     UPDATE EMP
     SET EMP_NAME='TEST';

     COMMIT;

     v_id := v_id + 1;

        IF (v_id != 0)) THEN
            xx_FIRST(v_id);
        ELSE
            yy_SECOND(v_id);
        END IF;
END;Start Free Trial
[+][-]10.29.2002 at 09:24PM PST, ID: 7386229

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle 3rd Party Tools
Tags: oracle, b_cursor, procedures, recursive
Sign Up Now!
Solution Provided By: M-Ali
Participating Experts: 4
Solution Grade: B
 
 
[+][-]10.29.2002 at 09:48PM PST, ID: 7386299

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.10.2002 at 05:14AM PST, ID: 7430406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.05.2003 at 04:37AM PST, ID: 9881815

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32