NEW! - Download: Date Sheet for Board Examination 2012 - Class 10th  |  Class 12th

(E-Book) Class XII Informatics Practices : Chapter - II (Iteration And Cursors)

Chapter – II

Iteration And Cursors

(Informatics Practices)


A cursor is a variable that can be used to access the result of a particular SQL query.

Cursors can move sequentially from row to row (cf. file pointers in C).

Every SQL query statement in PL/SQL has an implicit cursor.
It is also possible to declare and manipulate cursors explicitly:
    DECLARE
         CURSOR e IS
        SELECT * FROM Employees
        WHERE salary > 30000.00;
BEGIN

Cursors provide flexibility in processing rows of a query.
Simplest way to deal with a cursor is to loop over all rows using a FOR loop:
    DECLARE
        CURSOR e IS
        SELECT * FROM Employees
        WHERE salary > 30000.00;
    total INTEGER := 0;..................




Get Your Dream Job.Post Your Resume Online.