Code for Cursor to update salary details of an employee in Oracle
DECLARECURSOR A ISSELECT EMP_CODE,SALARY FROM EMPLOYEE WHERE DEPTNO=102;
CODE EMPLOYEE.EMP_CODE%TYPE;
SAL EMPLOYEE.SALARY%TYPE;
BEGINOPEN A;
LOOP
FETCH A INTO CODE,SAL;
EXITWHEN A%NOTFOUND;
UPDATE EMPLOYEE
SET SALARY=SAL+(SAL*0.20) WHERE EMP_CODE=CODE;
INSERTINTO EMPLOYEE_RAISE VALUES(CODE,SYSDATE,SAL*0.05);
END LOOP;
CLOSE A;
END;