PC Review


Reply
Thread Tools Rate Thread

calling oracle stored proc from .net

 
 
=?Utf-8?B?Vmlua2k=?=
Guest
Posts: n/a
 
      11th Jun 2007
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.


 
Reply With Quote
 
 
 
 
bob
Guest
Posts: n/a
 
      11th Jun 2007
Hi,
if using the Oracle client
OracleType.Varchar
hth
Bob
On Mon, 11 Jun 2007 12:29:00 -0700, Vinki
<(E-Mail Removed)> wrote:

>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.
>

 
Reply With Quote
 
=?Utf-8?B?Vmlua2k=?=
Guest
Posts: n/a
 
      12th Jun 2007
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" wrote:

> Hi,
> if using the Oracle client
> OracleType.Varchar
> hth
> Bob
> On Mon, 11 Jun 2007 12:29:00 -0700, Vinki
> <(E-Mail Removed)> wrote:
>
> >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.
> >

>

 
Reply With Quote
 
Gregg Walker
Guest
Posts: n/a
 
      12th Jun 2007
> 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.

--
Gregg Walker


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the oracle stored proc value in .net =?Utf-8?B?Vmlua2k=?= Microsoft Dot NET 1 13th Jun 2007 02:08 PM
return value from Oracle stored proc =?Utf-8?B?Vmlua2k=?= Microsoft C# .NET 2 12th Jun 2007 10:08 PM
calling stored proc from oracle =?Utf-8?B?Vmlua2k=?= Microsoft C# .NET 0 12th Jun 2007 01:09 AM
stored proc /w Oracle and Ado.Net coltrane Microsoft ADO .NET 5 2nd May 2005 12:27 PM
exec Oracle stored proc Microsoft Access Queries 1 28th Oct 2003 12:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:21 PM.