一些关键字的功效及用法
1.returning:返回update,delete和insert操作影响到的行
如:
CREATE OR REPLACE PROCEDURE sp_test_type(
i_empno NUMBER)
AS
TYPE type_test IS RECORD(
empno NUMBER(4),
ename VARCHAR2(10),
sal NUMBER(7,2),
deptno NUMBER(2)
);
v_emp type_test;
BEGIN
UPDATE emp a SET a.ename='杨老花'
WHERE a.empno=i_empno
RETURNING empno,ename,sal,deptno INTO v_emp;
COMMIT;
dbms_output.put_line(v_emp.empno||','||v_emp.ename||','||v_emp.sal||','||v_emp.deptno);
END;