rtc project

declare
cursor c1 is select * from route_header where route_id=&v_route_id;
--r1 c1%rowtype;
v_distance route_header.distance%type;
v_route_id route_header.route_id%type;
begin
for z in c1 loop
exit when c1%notfound;
if v_distance<500 then
update route_header set fare=198.98 where route_id=v_route_id;
elsif v_distance>501 and v_distance<=1000 then
update route_header set fare= 876.98 where route_id=v_route_id;
elsif v_distance>1000 then
dbms_output.put_line('fare is fixed');
end if;
end loop;
end;
/

No comments:

Post a Comment

Template Design by faris vio