This is yet another interesting Oracle feature. The ability to see what is being updated rather than issuing a select statement.
set serveroutput on;
Declare
UpdatedEname EMPNO.Ename%Type;
UpdatedDeptno DEPTNO.Deptno%Type;
BEGIN
UPDATE scott.emp
set ename= 'Sameer',
deptno= (select deptno from dept where dname='SALES')
where ename='FORD'
RETURNING
ename,deptno
INTO
UpdatedEname, UpdatedDeptno;
Dbms_output.put_line('value of Updated Emp Name is ' UpdatedEname);
Dbms_output.put_line('value of Updated Deptno is ' UpdatedDeptno);
END;
/
Saturday, April 28, 2007
Subscribe to:
Posts (Atom)