Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PLS-00306: wrong number or types of arguments

Re: PLS-00306: wrong number or types of arguments

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/08/28
Message-ID: <340a0bfe.12016508@newshost>#1/1

the problem is that once you declare a TYPE, never, never declare it again as it will be a completely different type. the strTabType in the anonymous block is *different* from the strTabType in the util package (i know, we as humans can see they are obviously the same but the compiler -- being strongly typed -- disagrees).

Instead of:

declare
TYPE StrTabType is table of Varchar2(2000)

   index by binary_integer;

	rc		REAL;
	sample__type varchar2(1);
	nr number;
	vals StrTabType;
	cols StrTabType;

you should:

declare

	rc		REAL;
	sample__type varchar2(1);
	nr number;
	vals util.StrTabType;
	cols util.StrTabType;


Just refer to the type you already created in the spec of util in the anonymous block....

On Wed, 27 Aug 1997 15:43:26 -0500, Larry Jones <lljo_at_chevron.com> wrote:

>I know this seems like an easy problem, but 3 of us have looked at this
>for a total of about 2 man hours, and we cannot find the problem!
>
>Below is portion of the PL/SQL code we are using to test a new package,
>just calling, it to make sure it works before we call it from
>PowerBuilder. I have also included the header and decleration part of
>the body of the package.
>
>Can anyone look at this code, and tell me what in the world is wrong
>with the call?????
>
>BTW... Our versions are as follows:
>SQL*Plus: Release 3.3.2.0.2
>Oracle7 Server Release 7.1.6.2.0
>PL/SQL Release 2.1.6.2.0
>
>********************** Begin PL/SQL script to call function (TEMP2NEW)
>declare
>TYPE StrTabType is table of Varchar2(2000)
> index by binary_integer;
>
> rc REAL;
> sample__type varchar2(1);
> nr number;
> vals StrTabType;
> cols StrTabType;
> errcode number;
> errmsg varchar2(100);
> errline number;
> errkey1 varchar2(60);
> errkey2 varchar2(14);
>.
>.**************** (assignments to varibles, etc are in here)
>.
>rc :=util.import(sample__type,nr,cols, vals, errcode, errmsg, errline,
>errkey1, errkey2);
>
>********************** End PL/SQL script to call function
>
>
>********************** Begin Package creation
>CREATE OR REPLACE PACKAGE util AS
>TYPE StrTabType is table of Varchar2(2000)
> index by binary_integer;
>
>-- Public variables accessed outside of package --
>cols StrTabType;
>vals StrTabType;
>tab_name StrTabType;
>col_name StrTabType;
>value StrTabType;
>nrow number;
>errcode number;
>errmsg varchar2(100);
>errline number;
>etext varchar2(60);
>anl_table varchar2(14);
>
>FUNCTION import (sample__type varchar2, nr in number, cols in
>StrTabType, vals in StrTabType,
> errcode out number, errmsg out varchar2, errline
>out number, errkey1 out varchar2,
> errkey2 out varchar2)
> return real;
>
>END util;
>/
>CREATE OR REPLACE PACKAGE BODY util AS
>
>----------------------------------------------------------------
>-- Main function for importing which calls previous functions --
>----------------------------------------------------------------
>
>FUNCTION import (sample__type varchar2,
> nr in number, cols in StrTabType, vals in
>StrTabType,
> errcode out number, errmsg out varchar2, errline
>out number,
> errkey1 out varchar2, errkey2 out varchar2)
> return real
> IS
>********************** End Package creation
>
>
>********************** Begin Execute script, and error that is returned
>GEOCHEM/HPRD716> @temp2new
>declare
> *
>ERROR at line 1:
>ORA-06550: line 104, column 6:
>PLS-00306: wrong number or types of arguments in call to 'IMPORT'
>ORA-06550: line 104, column 1:
>PL/SQL: Statement ignored
>
>********************** End Execute script, and error that is returned
>
>
>The line number (104) is the call statement (rc:=util.import....).
>
>
>I would appreciate any quick responses that you may have.
>Oh, one more thing.... we tested this on a 7.3.2 version of Oracle, and
>got the same problem, so it's not a version problem, per se.
>
>Thanks,

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Aug 28 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US