Solved

PLS-00306: wrong number or types of arguments in call to 'GET_COUNT_OF_DNIS1'

Posted on 2003-11-24
4
21,001 Views
Last Modified: 2011-08-18
I,
I have written this simple SP to pass one value to the SP and return three values.
The procedure is as below:

create or replace procedure get_count_of_dnis1
(
dnis_in_out in out varchar,
scr_out out varchar,
no_cnt out varchar)

As
begin
select count(*) into no_cnt from routing where dnis1 like dnis_in_out or dnis2 like dnis_in_out;
select menu_script into scr_out from routing where dnis1 like dnis_in_out or dnis2 like dnis_in_out;
dbms_output.put_line(scr_out);
dbms_output.put_line(no_cnt);
end;
/
the procedure compiles OK but when I try to run the procedure like execute get_count_of_dnis1(0870321321);

I get the following error.

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_COUNT_OF_DNIS1'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

I am using the parameter passed in to SP in a query in the body of procedure. Any ideas why this is happening ?
0
Comment
Question by:tabrezgm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9810163
since the SP has 3 OUT arguments, then this line:

execute get_count_of_dnis1(0870321321);


is clearly in error, EXACTLY as the error massage indicates.  You need to supply THREE variables as the arguments of the line:

execute get_count_of_dnis1(Var1, Var2, var3);

here var1, var2 and var3 will RECIEVE the output values from the stored procedure.

AW
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 500 total points
ID: 9810199
sorry, misread the SP declaration.  YOu need to supply the variables to hold the two vales that are declared as PURE OUT paramaters:

execute get_count_of_dnis1('0870321321', Var2, Var3);

assuming that '0870321321' is the correct value for dnis_in_out.

0
 

Author Comment

by:tabrezgm
ID: 9810301
AW,
I tried your recommendation but here is the error message I get

SQL> exec get_count_of_dnis1('0870321321',scr_out,no_cnt);
BEGIN get_count_of_dnis1('0870321321',scr_out,no_cnt); END;

                                      *
ERROR at line 1:
ORA-06550: line 1, column 39:
PLS-00201: identifier 'SCR_OUT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Any ideas ???
0
 

Expert Comment

by:bhaskersr
ID: 9836077
If the procedure is having the Out parameter u can't run from the sql prompt.

For this what u have to do is

u have to declare the two values. ie.

declare
scr_out varchar2(20);
no_cnt varhcar2(20);
begin
get_count_of_gnis1('0870321321',scr_out,no_cnt);
dbms_output.put_line(scr_out);
dbms_output.put_line(no_cnt);
end;
/

excute this block u will get the ansower.

0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question