Plsql updating in cursor
Here’s an example: (Note that I usually add a “_cur” suffix to the names of my explicitly declared cursors.) Whenever you are fetching data from a cursor into PL/SQL variables, you should declare a record based on that cursor with %ROWTYPE and fetch into that record.It’s rare, in fact, that the data with which you are working is just a single value, so records and other composite datatypes are likely to figure prominently in your PL/SQL programs.This article explores how you declare records, populate them with rows from a table, and even insert or change an entire row in a table by using a record.The following block uses a cursor FOR loop to fetch only the last name of each employee, deposit that name into a record, and then display the value of the last_name field of that record: You can define parameters based on record types, and you can therefore pass records as arguments to subprograms.
Suppose I need to write a procedure that displays an employee.
PL/SQL offers special syntax in both the INSERT and UPDATE statements so that you can easily use records to perform those data manipulation language (DML) operations as well.
Plsql updating in cursor comments