calling oracle stored proc from .net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone,

I am trying to call a oracle stored proc from .net code and I am getting
an error
PLS-00306: wrong number or types of arguments in call to KSSP_MEMBER_NEW. I
counted all the number of parameters that I am passing and they seem to be
ok, but type can be the problem. In oracle stored proc , the type is defined
as for example: dayPhone IN MEMBERTable.DayPhone%type
In my ocde I am definig day phone as DbType.string
db.AddInParameter(dbCommand, "dayPhone", DbType.String,
strList[137].ToString());

Is there any way I can define the dayPhone differently.
 
I am using oracleclient, but I want to use enterprise library too and with
enterprise library if I try to use oracleType.varchar, I get a syntax errror
The best overloaded method match for
'Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter(System.Data.Common.DbCommand,
string, System.Data.DbType, object)' has some invalid arguments
This is what my code looks like
db.AddInParameter(dbCommand, "dayPhone", OracleType.VarChar,
strList[9].ToString().Trim());

bob said:
Hi,
if using the Oracle client
OracleType.Varchar
hth
Bob
Hello Everyone,

I am trying to call a oracle stored proc from .net code and I am getting
an error
PLS-00306: wrong number or types of arguments in call to KSSP_MEMBER_NEW. I
counted all the number of parameters that I am passing and they seem to be
ok, but type can be the problem. In oracle stored proc , the type is defined
as for example: dayPhone IN MEMBERTable.DayPhone%type
In my ocde I am definig day phone as DbType.string
db.AddInParameter(dbCommand, "dayPhone", DbType.String,
strList[137].ToString());

Is there any way I can define the dayPhone differently.
 
The best overloaded method match for
'Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter(System.Data.Common.DbCommand,
string, System.Data.DbType, object)' has some invalid arguments
This is what my code looks like
db.AddInParameter(dbCommand, "dayPhone", OracleType.VarChar,
strList[9].ToString().Trim());

Vinki - You cannot use an OracleType where a DbType is called for. I would
trying the following and see if it works.

db.AddInParameter(dbCommand, "dayPhone", DbType.String,
strList[9].ToString().Trim());

or ...


db.AddInParameter(dbCommand, "dayPhone", DbType.AnsiString,
strList[9].ToString().Trim());

Oracle should have a document that maps the OracleType values and .Net Type
values to DbType values. This would help you figure out which DbType is
most appropriate for OracleType.VarChar.
 
Back
Top