Professional Documents
Culture Documents
UPDATE table-name
SET column-1 = value [, column-2 = value] ...
WHERE CURRENT OF cursor-name
END-EXEC.
EXEC SQL
DECLARE THISEMP CURSOR FOR
SELECT EMPNO, LASTNAME,
WORKDEPT, JOB
FROM aaA.EMPLOYEE
FOR UPDATE OF JOB
END-EXEC.
EXEC SQL
UPDATE aaA.EMPLOYEE
SET JOB = :NEW-CODE
WHERE CURRENT OF THISEMP
END-EXEC.
EXEC SQL
DELETE FROMaaa.EMPLOYEE
WHERE CURRENT OF THISEMP
END-EXEC.
Step 5b: Deleting the current row.
Branch back to fetch and process the next row.
CLOSE-THISEMP.
EXEC SQL
CLOSE THISEMP
END-EXEC.
Step 6: Closing the cursor.
For the scrollable cursor example, the program uses the RELATIVE position option to
obtain a representative sample of salaries from department D11.
-------------------------
IMHO S522 stands for too long waiting for mounting a required device like tape or
disk.
============