Вы находитесь на странице: 1из 1

declare

cursor c1 is select * from flight_traines where grade=&grade;


rec c1%rowtype;
begin
for rec in c1 loop
if rec.grade='C' then
insert into fnew values(rec.Pid,rec.FlightType,rec.sal,rec.grade);
delete from flight_traines where grade=rec.grade;
end if;
if rec.grade='A' then
update flight_traines set sal=sal+1000 where grade=rec.grade;
else
update flight_traines set sal=sal+2000 where grade=rec.grade;
end if;
end loop;
commit;
end;
.
/