The Oracle PL/SQL language was designed to be a portable, high-performance transaction processing language that is tightly integrated with the SQL language.
It is rare, indeed, to find a PL/SQL program that does not either read from or make changes to tables in a database.
If the database administrator changes the maximum length of the last_name column to 200, for instance, this procedure’s status will be changed to INVALID.
When the procedure is recompiled, the compiler will update the definition of the record in this procedure to match the table’s new structure.
You can also, however, assign values directly to individual fields or even to the record as a whole by using the PL/SQL assignment operator (:=).
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.
You can do this at the record level or by referencing individual fields of that record, with the same dot notation used in SQL to refer to the column of a table.