Lecture 4 [Part 1]
update employee
set salary = v_employee.salary + 10000
where empid = v_employee.empid;
end
Cursor overview
Very powerful in PL/SQL modules
Allows more than one set of data to be
retrieved and accessed at the same time in
loops
Sets are created by executing SQL
statements embedded in the PL/SQL code
Cursor attributes - %notfound, %rowcount,
%found & %isopen
Error handling
Prevents database locking
Ensures that errors are presented to the user
in a sensible format
Makes code robust
Essential when using PL/SQL as formal
programming language or interfacing with
Oracle applications.