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
At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Boolean Values Only the values TRUE, FALSE, & NULL can be assigned to a Boolean variable. For illustration, given the declaration DECLARE done BOOLEAN; the following statements

Using the student and faculty tables create a select query that outputs all students for a specific advisor. Generate the execution plan, select out the explain plan . Create an

Example of WRAP Operator - SQL The effect of Example can be obtained in SQL but note that one needs to write down not only the names of the columns being wrapped but also the

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

Write a query to find academics that are authors and that have only ever coauthored papers with authors from institutes in the same state as their own. List their academic number,

GOTO Statement   The GOTO statement branches categorically to a block label or statement label. The label should be exclusive within its scope and should precede a PL/SQL bloc

query to Find the account numbers of all customers whose balance is more than 10,000 $

Example of ADD CONSTRAINT in SQL Example: Alternative formulation for MAX_ENROLMENTS ALTER TABLE IS_ENROLLED_ON ADD CONSTRAINT MAX_ENROLMENTS CHECK ((SELECT COUNT (*)

Definition of CROSS JOIN - SQL Let s = t1 CROSS JOIN t2, where t1 and t2 are table expressions optionally accompanied by range variables. Then: Note: Here T denotes Table