Thursday, 14 September 2017

Update with RETURNING clause




1
2
3
4
5
6
7
8
9
10

DECLARE TYPE TYPE_NAME_TB IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER; TYPE_NAME_TB_V TYPE_NAME_TB; EMPNAME VARCHAR2(4000); EMPSALARY VARCHAR2(400); BEGIN UPDATE EMP SET SAL = SAL + 1000 WHERE DEPTNO=20 RETURNING ENAME BULK COLLECT INTO TYPE_NAME_TB_V; FOR I IN 1.. TYPE_NAME_TB_V.COUNT LOOP DBMS_OUTPUT.PUT_LINE(TYPE_NAME_TB_V(I)); END LOOP; END;

No comments:

Post a Comment