Use RETURNING clause of the UPDATE ststement. For example:
Code:
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.1.1 - Production
With the Partitioning option
JServer Release 8.1.7.1.1 - Production
SQL> set serveroutput on
SQL> DECLARE
2 v_sal NUMBER;
3 BEGIN
4 SELECT sal INTO v_sal FROM emp WHERE ename = 'KING';
5 dbms_output.put_line('Salary before the update: ' || v_sal);
6 UPDATE emp SET sal = sal*2 WHERE ename = 'KING'
7 RETURNING sal INTO v_sal;
8 dbms_output.put_line('Salary after the update: ' || v_sal);
9 END;
10 /
Salary before the update: 8450
Salary after the update: 16900
PL/SQL procedure successfully completed.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?