
Using the RETURNING Clause with a Record
DECLARE
TYPE emprec IS RECORD(last_name employees.last_name%TYPE,
salary employees.salary%TYPE);
emp_info EMPREC;
emp_id NUMBER := 100;
BEGIN
UPDATE employees
SET salary = salary * 1.1
WHERE employee_id = emp_id
RETURNING last_name,salary INTO emp_info;
dbms_output.Put_line('Just gave a raise to '
||emp_info.last_name
||', who now makes '
||emp_info.salary);
ROLLBACK;
END;
/

0 comments:
Post a Comment