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

EXECUTE IMMEDIATE Statement   The EXECUTE IMMEDIATE statement prepare (parses) and instantly executes a dynamic SQL statement or an anonymous PL/SQL block. Syntax:

Using EXCEPTION_INIT To handle unnamed internal exceptions, you should use the OTHERS handler or the pragma EXCEPTION_INIT. The pragma is a compiler directive that can be th

THEORY OF BIOGENESIS - This theory explains that the existing living organisms originated from pre-existing living beings not from non living entities. This concept of or

Control Structures The Control structures are the most important PL/SQL extension to the SQL. Not only does PL/SQL let you manipulate Oracle data, it lets you process the data

DBMS: The answer to this question is of course given in of the theory book. This book is concerned with SQL DBMSs and SQL databases in particular. Soon we will be looking a

Demonstrate your knowledge of PL/SQL programming by writing and thoroughly testing triggers and stored procedures associated with an e-commerce application that provides security l

Using Pragma RESTRICT_REFERENCES: The function called from the SQL statements should obey certain rules meant to control the side effects. To check for violation of the rules,

Aggregate Operators SQL Supports all of the aggregate operators mentioned in the theory book and many more besides. The syntax, however, involves an unusual trick that SQL cal

Type versus Representation Confusion in SQL This describes how a value might have two or more distinct representations. For example, user-defined type POINT might have a decla