Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace procedure s
- (p_sno student.sno%type)
- is
- l_srec student%rowtype;
- begin
- select * into l_srec from student
- where sno=p_sno;
- l_srec.avge:=(l_srec.munix + l_srec.msql)/2;
- if l_srec.avge >= 90 and l_srec.avge <= 100
- then
- l_srec.result:='A';
- elsif l_srec.avge >=80 and l_srec.avge < 90
- then
- l_srec.result:='B';
- elsif l_srec.avge >=70 and l_srec.avge < 80
- then
- l_srec.result:='C';
- else
- l_srec.result:='F';
- end if;
- update student set
- avge=l_srec.avge,
- result=l_srec.result
- where sno=l_srec.sno;
- dbms_output.put_line(l_srec.sno || 'result is calculated');
- exception
- when no_data_found
- then
- dbms_output.put_line('values are not present');
- end;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement