Opening a cursor, PL-SQL Programming

Opening a Cursor

Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared using the FOR UPDATE clause, the OPEN statement also locks these rows. An illustration of the OPEN statement is as shown:

DECLARE

CURSOR c1 IS SELECT ename, job FROM emp WHERE sal < 3000;

...

BEGIN

OPEN c1;

...

END;

The Rows in the result set are not retrieved when the OPEN statement is executed. Instead, the FETCH statement retrieves the rows.

Posted Date: 10/4/2012 3:52:25 AM | Location : United States







Related Discussions:- Opening a cursor, Assignment Help, Ask Question on Opening a cursor, Get Answer, Expert's Help, Opening a cursor Discussions

Write discussion on Opening a cursor
Your posts are moderated
Related Questions
Using SAVEPOINT The SAVEPOINT names and marks the present point in the processing of a transaction. Used with the ROLLBACK TO statement, the savepoints undo parts of a transac

Table Comparison - SQL The following definitions for relation comparisons: Let r1 and r2 be relations having the same heading. Then: r1 ⊆ r2 is true if every tuple of r1

Cursor Variables As Parameters You can declare the cursor variables as the formal parameters of the functions and procedures. In the illustration below, you define the REF CUR

Effects of NULL for Multiple Assignments - SQL If the row expression given as the source for a multiple assignment evaluates to NULL, then NULL is assigned to each target. If

Relational Algebra - SQL It describes some operators, that together constitute an algebra that is not only relationally complete but also irreducibly so (very nearly- apart f

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

Parameter and Keyword Description: select_item: This select_item is a value returned by the SELECT statement, and then assigned to the equivalent variable or field in the

Providing Results of Queries Expressing queries in SQL is the (big) subject. Here I present just a simple example to give you the flavour of things to come in those chapters.

Fetching with a Cursor The FETCH statements retrieve the rows in the result set one at a time. After each and every fetch, the cursor advance to the next row in the result set

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw