Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-11-24
4
Medium Priority
?
21,034 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 2000 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

609 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