posted 19 years ago
create or replace procedure update_status(t_amt in real) is
myno supplies.s_num%type;
tot_amt real;
cursor snum is select s_num from supplies s,charges c
where s. s_num = c.ch_s_num
and s.p_num = c.ch_p_num;
begin
open snum;
loop
fetch snum into myno;
tot_amt:= suppliers_total_charges(myno);
if tot_amt = 0 then
update supplier set s_status =1 where s_num=myno;
elsif tot_amt BETWEEN 0.01 AND 99.99 THEN
update supplier set s_status =2 where s_num=myno;
elsif tot_amt BETWEEN 100 AND 199.99 THEN
update supplier set s_status =3 where s_num=myno;
elsif tot_amt BETWEEN 200 AND 299.99 THEN
update supplier set s_status =4 where s_num=myno;
elsif tot_amt BETWEEN 300 AND 399.99 THEN
update supplier set s_status =5 where s_num=myno;
elsif tot_amt BETWEEN 400 AND 499.99 THEN
update supplier set s_status =6 where s_num=myno;
elsif tot_amt BETWEEN 500 AND 699.99 THEN
update supplier set s_status =7 where s_num=myno;
elsif tot_amt BETWEEN 700 AND 999.99 THEN
update supplier set s_status =8 where s_num=myno;
elsif tot_amt BETWEEN 1000 AND 1599.99 THEN
update supplier set s_status =9 where s_num=myno;
elsif tot_amt >= 1599.99 THEN
update supplier set s_status =10 where s_num=myno;
end if;
exit when snum%NOTFOUND;
end loop;
close snum;
end;
/
*********** the error after executing this procedure is as below..********
SQL> execute update_status
BEGIN update_status; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'UPDATE_STATUS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
plz help me in this,so i can go on to my next step thanks..