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:37 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

Using ROLLBACK The ROLLBACK statements end the present transaction and undo any change made during the transaction. The Rolling back is helpful for two reasons. Firstly, if yo

IF Statement The IF statement executes a series of statement conditionally. Whether the series is executed or not depends on the value of the Boolean expression. Syntax:

Parameter & Keyword Description: function_name: The user-defined function is identifying by that keyword. parameter_name: This identifies the formal parameter that

What Is a Record  ? A record is a group of related data items that stored in the fields, each with its own name and datatype. Assume that you have different data about an em

%ROWCOUNT The %ROWCOUNT yields the number of rows affected by the INSERT, UPDATE, or DELETE statement, or returned by a SELECT INTO statement. The %ROWCOUNT yields zero when a

Data Abstraction The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to reme

Using COMMIT The COMMIT statements end the present transaction and make permanent any changes made during that transaction. Till you commit the changes, other users cannot acc

Example of WHEN or THEN Constraints A concrete example showing how SQL supports WHEN/THEN constraints CREATE TABLE SAL_HISTORY (EmpNo CHAR (6), Salary INTEGER NOT NULL,

Parameter and Keyword Description: dynamic_string: This is a string variable, literal, or expression which represents a SQL statement or the PL/SQL block. define_vari