Plsql
delimiter $
create procedure fine.calculation(IN rno int(3), brame char(20))
begin
declare i date date;
declare diff int;
declare fine.ast int;
declare exit handler for sqlexception select 'Table not Found";
select dateofIssue into i date from borrower where rollin rno and bname -bname;
select datediff(curdate(),i_date) into diff;
if(diff>15 and diffe30) then
set fine ost diffe5;
insert into fine values(rno, curdate(), fine.cat);
elseif(diff>38) then
set fine ont- 15°5 (diff-30)*50; insert into fine values(rno, curdote, fine,ast);
end if;
update borrower set status 'R' where rollin-rno and bnane -bname;
end;
Comments
Post a Comment