Solved

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

Posted on 2011-09-22
2
2,613 Views
Last Modified: 2013-12-19
Hi Gurus,

I'm trying to resolve this but in vain. I know its simple but not sure what;s wrong. Please advice


Proc when executed without giving the parameter names it works.
But when given i.e calling using => it fails.

Error report:
ORA-06550: line 10, column 3:
PLS-00306: wrong number or types of arguments in call to 'PROC1'
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored

Please advice. Attached is the code.  
create or replace procedure proc1(i_name   IN varchar2,
                                  o_owner  OUT varchar2,
                                  o_type   OUT varchar2,
                                  o_id     OUT varchar2
                                  ) 
as
 v_owner  varchar2(30) := '';
 v_type   varchar2(30) := '';
 v_id  varchar2(30) := '';
begin
 select owner,object_type,data_object_id
  into v_owner,v_type,v_id
  from all_objects
 where UPPER(object_name) = UPPER(i_name);
  o_owner := v_owner;
  o_type  := v_type;
  o_id    := v_id;
end;
/

-- Test Case 1: Call Proc 
declare
 ip_name  varchar2(30) := '';
 v_owner  varchar2(30) := '';
 v_type   varchar2(30) := '';
 v_id     varchar2(30) := '';
begin
  ip_name := 'EMP';
  proc1(ip_name,
        v_owner,
        v_type,
        v_id       
        );
 dbms_output.put_line ('ip_name - '||ip_name);
 dbms_output.put_line ('v_owner - '||v_owner);
 dbms_output.put_line ('v_type - '||v_type);
 dbms_output.put_line ('v_id - '||v_id);
end;
/

-- test Case 2: Call proc FAILS

declare
 ip_name  varchar2(30) := '';
 v_owner  varchar2(30) := '';
 v_type   varchar2(30) := '';
 v_id     varchar2(30) := '';
begin
  ip_name := 'EMP';
  proc1(testname  => ip_name,
        testowner => v_owner,
        testtype  => v_type,
        testid    => v_id       
        );
 dbms_output.put_line ('ip_name - '||ip_name);
 dbms_output.put_line ('v_owner - '||v_owner);
 dbms_output.put_line ('v_type - '||v_type);
 dbms_output.put_line ('v_id - '||v_id);
end;
/

Open in new window

0
Comment
Question by:loginboy
[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 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 36584885
if you use the named parameter method, you must use the correct parameter names


change this...

 proc1(testname  => ip_name,
        testowner => v_owner,
        testtype  => v_type,
        testid    => v_id      
        );


to this ...


 proc1(i_name => ip_name,
        o_owner => v_owner,
        o_type => v_type,
        o_id => v_id      
        );
0
 
LVL 3

Expert Comment

by:cklautau
ID: 36584892
You have to use the parameters name defined on the procedure; try:
declare
 ip_name  varchar2(30) := '';
 v_owner  varchar2(30) := '';
 v_type   varchar2(30) := '';
 v_id     varchar2(30) := '';
begin
  ip_name := 'EMP';
  proc1(i_name  => ip_name,
        o_owner => v_owner,
        o_type  => v_type,
        o_id    => v_id      
        );
 dbms_output.put_line ('ip_name - '||ip_name);
 dbms_output.put_line ('v_owner - '||v_owner);
 dbms_output.put_line ('v_type - '||v_type);
 dbms_output.put_line ('v_id - '||v_id);
end;
/
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

691 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