%notfound - explicit cursor attributes, PL-SQL Programming

%NOTFOUND

The %NOTFOUND is logical, opposite of the %FOUND. The %NOTFOUND yields FALSE if the last fetch returned a row, or TRUE when the final fetch failed to return a row. In the illustration below, you use the %NOTFOUND to exit a loop if FETCH fails to return a row:

LOOP

FETCH c1 INTO my_ename, my_sal, my_hiredate;

EXIT WHEN c1%NOTFOUND;

...

END LOOP;

Before the first fetch, the %NOTFOUND evaluates to NULL. Therefore, if FETCH never executes effectively, the loop is never existed. That is as the EXIT WHEN statement executes only if it's WHEN condition is true. To be secure, you might want to use the EXIT statement below instead:

EXIT WHEN c1%NOTFOUND OR ci%NOTFOUND IS NULL;

When a cursor or cursor variable is not open, referencing it with the %NOTFOUND raises

INVALID_CURSOR.

Posted Date: 10/4/2012 4:11:04 AM | Location : United States







Related Discussions:- %notfound - explicit cursor attributes, Assignment Help, Ask Question on %notfound - explicit cursor attributes, Get Answer, Expert's Help, %notfound - explicit cursor attributes Discussions

Write discussion on %notfound - explicit cursor attributes
Your posts are moderated
Related Questions
Creating a Table Syantax: CREATE TABLE ENROLMENT (StudentId SID, Name   VARCHAR (30) NOT NULL, CourseId CID, PRIMARY KEY (StudentId, CourseId)) ; Explan

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,

%NOTFOUND The %NOTFOUND is logical, opposite of the %FOUND. The %NOTFOUND yields FALSE if the last fetch returned a row, or TRUE when the final fetch failed to return a row. I

Entering and Exiting If you enter the executable part of an autonomous routine, the major transaction suspends. When you exit the routine, the major transaction resumes. To ex

Stored Subprograms Normally, tools (like Oracle Forms) which incorporate the PL/SQL engine can store subprograms locally for later, strictly local execution. Though, to become

Bitmap Join Indexes - This feature will increase the performance and detains the size and format of your databases in data Character Semantics and Globalization -This featur

BIOCHE M ICA L ORIGIN OF LIFE - It is generally agreed by astronomers, geologists and biologists that the earth is approximately 4500-5000 million years old. It is an

(a) What are decision support systems, and what role do they play in the business environment? (b) Data warehousing is defined as "a subject-oriented, integrated, non-volatile c

First Step at defining type SID in SQL CREATE TYPE SID AS ( C VARCHAR(5) ) ; Explanation: TYPE SID announces that a type named SID is being defined to the syst

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op