Thursday, May 27, 2010

HOSPITAL INFORMATION SYSTEM

Buzz It
create table hospital(pid varchar2(5),pname varchar2(10),p_age number(5),doctor
varchar2(10),p varchar2(11),consfee number(5),total number(5));
insert into hospital values('p101','Banu',23,'Shukoor','out-patient',100,null);
insert into hospital values('p102','Hasna',18,'Thennal','in-patient',80,null);
insert into hospital values('p103','Nasiya',34,'Reshma','out-patient',90,null);
insert into hospital values('p104','Raheela',45,'Sruthi','in-patient',50,null);
insert into hospital values('p105','Ranjini',56,'Sithara','out-patient',100,null);
insert into hospital values('p106','Sona',12,'Jumana','in-patient',50,null);
insert into hospital values('p107','Thafseena',25,'Arifa','out-patient',100,null);
insert into hospital values('p108','Meher',08,'Sabreena','in-patient',80,null);
insert into hospital values('p109','Deepu',29,'Neeraj','out-patient',100,null);
insert into hospital values('p110','Bimal',35,'Vijeesh','in-patient',100,null);
declare
cursor c1 is
select * from hospital order by pid;
vtype c1%rowtype;
begin
dbms_output.put_line('MIMS HOSPITAL CALICUT-3,KERALA');
dbms_output.put_line('DETAILS OF THE PATIENTS');
dbms_output.put_line('----------------------------------------');
dbms_output.put_line('PID PNAME P_AGE DOCTOR P CONSFEE TOTAL');
dbms_output.put_line('----------------------------------------------');
open c1;
loop
fetch c1 into vtype;
exit when c1%notfound;
vtype.total:=vtype.consfee;
update hospital set total=vtype.total where pid=vtype.pid;
dbms_output.put_line('vtype.pid,vtype.pname,vtype.page,vtype.doctor,vtype.p,vtype.consfee
,vtype.total');
end loop;
dbms_output.put_line('-----------------------------------');
close c1;
end;
/

OUTPUT

MIMS HOSPITAL CALICUT-3,KERALA
DETAILS OF THE PATIENTS
----- ---------- --------- ---------- ----------- --------- ------------------ ------- -----
PID PNAME P_AGE DOCTOR P CONSFEE TOTAL
----- ---------- --------- ---------- ----------- --------- ------------------ ------- -----
p101 Banu 23 Shukoor out-patient 100 100
p102 Hasna 18 Thennal in-patient 80 80
p103 Nasiya 34 Reshma out-patient 90 90
p104 Raheela 45 Sruthi in-patient 50 50
p105 Ranjini 56 Sithara out-patient 100 100
p106 Sona 12 Jumana in-patient 50 50
p107 Thafseena 25 Arifa out-patient 100 100
p108 Meher 8 Sabreena in-patient 80 80
p109 Deepu 29 Neeraj out-patient 100 100
p110 Bimal 35 Vijeesh in-patient 100 100
----- ---------- --------- ---------- ----------- --------- ------------------ ------- -----

0 comments:

Post a Comment