Oracle Client SP Call Problem

  • Thread starter Thread starter prowler
  • Start date Start date
P

prowler

More info:

The more persistent and prevalent error msg I'm seeing
is "PLS-00306: wrong number or types of arguments ". I
have all of two params to the SP, one in, one out. In is
varchar(20), out is Char(3). Maybe it is a type mismatch
thing, no success so far. By the way, another SP which is
very similar, I can call with the OleDb provider, but not
with OracleClient!! It succeeds using the odd {} syntax,
not the params.add approach.
 
I haven't tried the "call" approach ... but i call my stored procedures in a different way ... see if this helps ...

OracleCommand oc = new OracleCommand();
oc.CommandType = CommandType.StoredProcedure;
oc.CommandText = "abc_PKG.GetCodeBYID";
oc.Connection = new OracleConnection("whatever connection string");

OracleParameter param1 = new OracleParameter("param1", Oracle.DataAccess.Client.OracleDbType.Char);
param1.Direction = ParameterDirection.Input;
/* similarly make other parameter objects */

oc.Parameters.Add(param1);
/* similarly add other parameter objects */

oc.ExecuteNonQuery(); /* or other execute methods */

This should work ... had you tried it this way ?

Nishith
 
Back
Top