Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
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…

679 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