Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. create or replace procedure s
  2. (p_sno student.sno%type)
  3. is
  4. l_srec student%rowtype;
  5. begin
  6. select * into l_srec from student
  7. where sno=p_sno;
  8. l_srec.avge:=(l_srec.munix + l_srec.msql)/2;
  9. if l_srec.avge >= 90 and l_srec.avge <= 100
  10. then
  11. l_srec.result:='A';
  12. elsif l_srec.avge >=80 and l_srec.avge < 90
  13. then
  14. l_srec.result:='B';
  15. elsif l_srec.avge >=70 and l_srec.avge < 80
  16. then
  17. l_srec.result:='C';
  18. else
  19. l_srec.result:='F';
  20. end if;
  21. update student set
  22. avge=l_srec.avge,
  23. result=l_srec.result
  24. where sno=l_srec.sno;
  25. dbms_output.put_line(l_srec.sno || 'result is calculated');
  26. exception
  27. when no_data_found
  28. then
  29. dbms_output.put_line('values are not present');
  30. end;
  31. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement