create or replace procedure info_disp(fname varchar2,yr C_F.year%type)
is
cursor c1 is select c.c_no,c.c_name,c_season,c.pesticides from Crop c ,Farmer f ,C_F cf
where c.c_no=cf.c_no and f.f_no=cf.f_no
and f.f_name=fname and cf.year=yr;
rec c1%rowtype;
begin
dbms_output.put_line(fname||' '||yr);
open c1;
loop
fetch c1 into rec;
exit when c1%notfound;
dbms_output.put_line(rec.c_no||' '||rec.c_name||' '||rec.c_season||' '||rec.pesticides);
end loop;
close c1;
end;
declare
name_of_farmer Farmer.f_name%type:='&name_of_farmer';
year1 C_F.year%type:=&year1;
begin
info_disp(name_of_farmer,year1);
end;
Q2)
create or replace trigger t9
before insert or update on C_F
for each row
begin
if (:new.year<:old.year) then
raise_application_error(-2010,'year should be enter less than current year');
end if;
end;