INSERT, UPDATE and DELETE DB2 Rowset Positioning
Example SQL queries to use rowset positioning to carry INSERT, UPDATE and DELETE of Multi rows
5 different best examples of Rowset positioning usage in DB2. These examples include to DELETE, UPDATE and SELECT multiple rows.
Tweet
SELECT – FETCH FIRST 20 ROWS WITH ROWSET POSITIONING
FETCH NEXT ROWSETFROM C1 FOR 20 ROWSINTO :HVA-EMPNO, :HVA-LASTNAME, :HVA-SALARY :INDA-SALARYEND-EXEC.
UPDATE – ROWS FROM ROWSET POSITIONING
The below query update salary to 5000 in all the rows of rowset result table.
EXEC SQLUPDATE DSN8B10.EMP SET SALARY = 50000WHERE CURRENT OF C1END-EXEC.
DELETE – ROWS FROM ROWSET POSITIONING
Below query deletes all the rows of rowset positioning result table.
EXEC SQLDELETE FROM DSN8B10.EMPWHERE CURRENT OF C1END-EXEC.
Recent Posts






