Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

function call within a procedure error !!

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are not using t_amt parameter, then why are you passing it. Actually, you are not defining the parameter correctly.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic