Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLS-00306 - wrong number or types of arguments in call......

721872Jun 23 2010 — edited Apr 29 2011
Hello All:

I know the technical reason as to why I am getting this error (my arguments are of the wrong type), but I do not know why it is occuring. It has something to do with my pPramArray array / Varchar2 value I am trying to set.

public void GetAppParams(string Family, string Application, string Param, ref string[] ParamArray)

Basically, I have the above web-service function header, that is going to call a Stored Procedure. ParamArray is an output parameter from the Stored Procedure, but is always passed to the function as NULL. I can’t set OracleDBType.Array as the ParameterType, as Oracle doesn’t have a native type of Array (I get a binding issue if I try). I found some literature on-line to do the following instead (which I am not overly pleased with, as what I am to do if the parameter list is above 100 long, or less than 100):

const int numToFetch = 100;
oCommand.Parameters.Add("pPramArray", OracleDbType.Varchar2).Value = System.DBNull.Value;
oCommand.Parameters["pPramArray"].CollectionType = OracleCollectionType.PLSQLAssociativeArray;
oCommand.Parameters["pPramArray"].Size = 100;
oCommand.Parameters["pPramArray"].ArrayBindSize = new int[numToFetch];
oCommand.Parameters["pPramArray"].Direction = System.Data.ParameterDirection.Output;

However: this is giving me the following error: PLS-00306 - wrong number or types of arguments in call.....

pPramArray is defined as following in the Oracle Stored Procedure:

pPramArray OUT OutParamArray
The OutParamArray is defined as below:
TYPE OutParamArray IS TABLE OF VARCHAR2(200);

Oracle doesn't have a native type of Array, so if I just set OracleDBType.Array as the parameter type in my .Net code, I get a binding error. If I try this method, that I have found online that others say is supposed to work, I get the error posted above.

How can I simply get an array returned from an oracle stored procedure (or technically, a collection because it doesn't have a native type array) to a .Net array in my code?

Any help is greatly appreciated.
This post has been answered by gdarling - oracle on Jun 23 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2011
Added on Jun 23 2010
5 comments
5,101 views