Recursive subprograms, PL-SQL Programming

Recursive Subprograms

The recursive subprogram is the one that calls itself. Think of a recursive call as a call to a few other subprograms that does the similar task as your subprogram. Each recursive call creates a new illustration of any items declared in the subprogram, involving parameters, cursors, variables, and exceptions. Similarly, the new instances of the SQL statements are created at each level in the recursive descent.

Be cautious where you place a recursive call. If you place it within a cursor FOR loop or between the OPEN and CLOSE statements, the other cursor is opened at each call. As a result, your program may exceed the limit set by the Oracle initialization parameter OPEN_CURSORS.

There should be at least two paths through a recursive subprogram: one that lead to the recursive call and one that does not. At least one path should lead to a terminating condition. Or else, the recursion would (theoretically) go on everlastingly. In practice, if a recursive subprograms stray into vast regress, the PL/SQL eventually runs out of memory and raises the predefined exception STORAGE_ERROR.

Posted Date: 10/5/2012 5:47:09 AM | Location : United States







Related Discussions:- Recursive subprograms, Assignment Help, Ask Question on Recursive subprograms, Get Answer, Expert's Help, Recursive subprograms Discussions

Write discussion on Recursive subprograms
Your posts are moderated
Related Questions
i NEED THE QURIES TO SOME OF THE PROBLEMS USING plsql

Creating a SQL file 1. Open a new file in Notepad++ and save it to the location c:\mysql\bin, with the name lab8script.sql (the file extension should be .sql ). Add a MySQL co

Question: Consider the following relations (primary keys are underlined): AUTHOR (ANo, aname, address, speciality) PUBLISHER (PNo, pname, Location) BOOK (BNo, Title, ISBN,

Third Step at defining type SID in SQL CREATE DOMAIN SID AS VARCHAR(5) CHECK ( VALUE IS NOT NULL AND SUBSTRING(VALUE FROM 1 FOR 1) = 'S' AND CAST('+'||SUBSTRING(VALUE

DBMS: The answer to this question is of course given in of the theory book. This book is concerned with SQL DBMSs and SQL databases in particular. Soon we will be looking a

SQL Database: So, an SQL database is one whose symbols are organized into a collection of tables. Now, shows an SQL table as the current value of an SQL variable, ENROLMENT, b

Information Hiding   With the information hiding, you see only the details that are significant at a given level of algorithm and data structure design. The Information hiding

Initializing Records The illustration below shows that you can initialize a record in its type definition. Whenever you declare a record of the type TimeRec, its 3 fields supp

CLOSE Statement The CLOSE statement allows the resources held by a cursor variable or open cursor to be reused. No more rows can be fetched from the cursor variable or closed

Write a cursor to open an employee database and fetch the employee record whose age is greater than 45