Solved

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

Posted on 2003-11-24
4
20,957 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
  • 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now