Explicit cursors, PL-SQL Programming

Explicit Cursors

The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns a multiple row, you can explicitly declare the cursor to process the rows. Furthermore, you can declare a cursor in the declarative part of any PL/SQL subprogram, block, or package.

You use 3 commands to control the cursor: OPEN, FETCH, & CLOSE. At First, you initialize the cursor with the OPEN statement that identifies the result set. Then, you use the FETCH statement to recover the first row. You can execute FETCH frequently until all rows have been retrieved. When the final row has been processed, you discharge the cursor with the CLOSE statement. You can process few queries in parallel by declaring and opening the multiple cursors.

Posted Date: 10/4/2012 3:50:54 AM | Location : United States







Related Discussions:- Explicit cursors, Assignment Help, Ask Question on Explicit cursors, Get Answer, Expert's Help, Explicit cursors Discussions

Write discussion on Explicit cursors
Your posts are moderated
Related Questions
Example of GROUPBY Operator Example: How many students sat each exam, using GROUP BY, NATURAL LEFT JOIN, and COALESCE SELECT CourseId, COALESCE (n, 0) AS n FROM COURS

Loop Labels Like the PL/SQL blocks, loops can also be labeled. The label, an undeclared identifier enclosed by double angle brackets, should appear at the beginning of the LOOP

Using Aggregation on Nested Tables Example is the most direct translation of its counterpart in the theory book that can be obtained in SQL but it is so over-elaborate that no

SQL Cursor   The Oracle implicitly opens a cursor to process each SQL statement not related with an explicit cursor. The PL/SQL refers to the most current implicit cursor as t

UNION without CORRESPONDING - SQL The use of UNION without CORRESPONDING. Example is merely by omitting CORRESPONDING, but only because the operands have identical SELECT clau

Character Types The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings. CHAR You use the CHAR dataty

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc

Parameter and Keyword Description: procedure_name The user-defined procedure is declared by this construct. parameter_name: This identifies the formal parameter t

Implicit Cursors The Oracle implicitly opens a cursor to process each SQL statement not related with an explicitly declared cursor. The PL/SQL lets you refer to the most recen

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