Logo 
Search:

Oracle Articles

Submit Article
Home » Articles » Oracle » CursorRSS Feeds

Cursor to update salary details of an employee

Posted By: Adelle Fischer     Category: Oracle     Views: 4636

Cursor to update salary details of an employee.

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;
  
Share: 


Didn't find what you were looking for? Find more on Cursor to update salary details of an employee Or get search suggestion and latest updates.

Adelle Fischer
Adelle Fischer author of Cursor to update salary details of an employee is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!