DECLARE
CURSOR emp_cur IS
SELECT employee_id, first_name,
(salary * .05) sal_hike
FROM employees
WHERE job_id LIKE '%_PROG'
ORDER BY employee_id;
emp_sal_rec emp_cur%ROWTYPE;
BEGIN
OPEN emp_cur;
LOOP
FETCH emp_cur INTO emp_sal_rec;
EXIT WHEN emp_cur%NOTFOUND;
DBMS_OUTPUT.PUT_LINE (
'Salary increased for ' || emp_sal_rec.first_name ||
' is: ' || emp_sal_rec.sal_hike
);
END LOOP;
CLOSE emp_cur;
END;
/
Sample Output:
output
SQL> /
Salary increased for Alexander is: 450
Salary increased for Bruce is: 300
Salary increased for David is: 240
Salary increased for Valli is: 240
Salary increased for Diana is: 210
PL/SQL procedure successfully completed.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer