number(8),electricity number(25),messfee number(5),oc number(10),specialfee
number(30),total number(25));
insert into hostel values(101,'Sithara',301,150,100,250,50,25,null);
insert into hostel values(102,'Thennal',302,150,100,45,50,25,null);
insert into hostel values(103,'Sruthi',303,100,150,36,50,25,null);
insert into hostel values(104,'Raheela',304,100,150,24,50,25,null);
insert into hostel values(105,'Reshma',305,150,150,25,50,25,null);
declare
cursor c1 is
select * from hostel order by slno;
vhos c1 %rowtype;
begin
dbms_output.put_line('date');
dbms_output.put_line('FAROOK COLLEGE CALICUT,KERALA');
dbms_output.put_line('HOSTEL DUE REPORT FOR THE MONTH OF
JANUARY 2010');
dbms_output.put_line('------------------------------------------------------------------');
dbms_output.put_line('slno name roomno rent electricity messfee OC specialfee
total');
open c1;
loop
fetch c1 into vhos;
exit when c1%notfound;
vhos.total:=vhos.rent+vhos.electricity+vhos.messfee+vhos.OC+vhos.specialfee;
update hostel set total=vhos.total where slno=vhos.slno;
end loop;
close c1;
dbms_output.put_line('---------------------------------------------------------------------');
dbms_output.put_line('warden');
end;
/
OUTPUT
FAROOK COLLEGE CALICUT.KERALAHOSTEL DUE REPORT FOR THE MONTH OF JANUARY 2010
---- ---------- --------- --------- ----------- --------- --------- ---------- - ------ ----------- - -- ---
SLNO NAME ROOMNO RENT ELECTRICITY MESS FEE OC SPECIALFEE TOTAL
---- ---------- --------- --------- ----------- --------- --------- ---------- - ------ ----------- - -- ---
101 Sithara 301 150 100 250 50 25 575
102 Thennal 302 150 100 45 50 25 370
103 Sruthi 303 100 150 36 50 25 361
104 Raheela 304 100 150 24 50 25 349
105 Reshma 305 150 150 25 50 25 400
---- ---------- --------- --------- ----------- --------- --------- ---------- - ------ ----------- - -- ---
0 comments:
Post a Comment