There is 3 way to use records (with cursor)
1 - creating cursor
and fetching it into record
You can create cursor (vc_MyCursor) and record (vr_RecEmployees) at the beginning of anonymous block and open it in begin-end section, then can fetch it into a record by using
FETCH vc_MyCursor INTO vr_RecEmployees;
At the cursor should be closed as
2 - using record as cursor of select statement in for loop
Simple you can create a local record in for loop as
FOR rec IN (SELECT * FROM employees e WHERE department_id = 30) LOOP
3 - using record based on cursor in for loop!
Another easier way to create a local record is using created cusrsor in for loop as
FOR rec IN vc_MyCursor LOOP
All codes are available in GitHub here.
If you want to check some real project with all PLSQL codes please check here
Till next time!