New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Resources » Articles/Knowledge Sharing » Education »

Payroll processing using cursor


Posted Date: 01 Nov 2009    Resource Type: Articles/Knowledge Sharing    Category: Education
Author: sasi kalaMember Level: Diamond    
Rating: 3 out of 53 out of 53 out of 5Points: 4



SQL> create table empll (empno number(5),empname varchar2(10),bp number(5));

Table created.

SQL> insert into empll values(1,'raji',20000);

1 row created.

SQL> insert into empll values(2,'meena',25000);

1 row created.

SQL> insert into empll values(3,'vani',20000);

1 row created.

SQL> declare
2 hra number(8,2);
3 da number(8,2);
4 ta number(6,2);
5 pf number(6,2);
6 tax number(6,2);
7 grosspay number(10,2);
8 netpay number(10,2);
9 cursor c1 is select * from empll;
10 r1 empll%rowtype;
11 begin
12 dbms_output.put_line('___________');
13 dbms_output.put_line('empno'||'empname'||'bp'||' grosspay'||'netpay');
14 dbms_output.put_line('___________');
15 for r1 in c1
16 loop
17 hra:=r1.bp*0.2;
18 da:=r1.bp*0.05;
19 ta:=r1.bp*0.1;
20 pf:=r1.bp*0.12;
21 grosspay:=r1.bp+hra+da+ta;
22 tax:=r1.bp*0.05;
23 netpay:= grosspay-tax-pf;
24 dbms_output.put_line(r1.empno||r1.empname||r1.bp||grosspay||netpay);
25 end loop;
26 end;
27 /
__________________________________
empno empname bp grosspay netpay
__________________________________
1 raji 20000 27000 23600
2 meena 25000 33750 29500
3 vani 20000 27000 23600

PL/SQL procedure successfully completed.



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Sql program  .  Payroll  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Conic Section : - Ellipse and Parabola
Previous Resource: Autonomous Syllabus Of Kumaraguru College Of Technology for 5th and 6th Semester
Return to Discussion Resource Index
Post New Resource
Category: Education


Post resources and earn money!
 
More Resources



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.