-- returning_into.sql

DECLARE
   sqltext VARCHAR2(500);
   new_pay NUMBER(9,2);
   eid NUMBER := 9995;
BEGIN
   sqltext := 'UPDATE employee SET pay_amount = pay_amount * 1.1 
                WHERE id = :id RETURNING pay_amount INTO :p';
   EXECUTE IMMEDIATE sqltext USING eid RETURNING INTO new_pay;
   DBMS_OUTPUT.PUT_LINE(new_pay);
END;
/
