Lizet:
I abandoned the System.Data.OracleClient at some point a
couple years
ago in favor of Oracle.DataAccess.Client.
It is much more durable and the interface seems to be
consistent as
far as IDB* type objects go.
In particular it's thread safe. I had problems I wasn't
able to
resolve until I did this which I'm not sure are related to
yours but
you might compare this API for yourself.
- Len
On 7/28/06, Lizet Pena de Sola <Lizet.Pena cit.com> wrote:
>
>
> Hi all,
>
> I am wondering if anyone has used it along with the
> System.Data.OracleClient. I'm having several troubles
biding common
> Oracle data types with .NET types.
>
>
>
> Here is the scenario:
>
>
>
> In the method that calls the SPROC I have the
following:
>
> Dim IObject As ICommonFactory
>
> Dim cmd As New OracleClient.OracleCommand
>
> Dim myQuote As New DataSet
>
> Try
>
> 'Write to Trace if Enabled
>
> ServiceHelper.RoutineBegin(Debug)
>
>
>
> cmd.CommandText =
"web.sp_web_quote_request2"
>
> cmd.CommandType =
CommandType.StoredProcedure
>
> With cmd
>
>
>
>
.Parameters.Add("iCONTRACT_NO",
> OracleType.VarChar).Value =
"333-333333-333"
>
>
.Parameters.Add("iTEMPLATE_NAME",
> OracleType.VarChar).Value =
"XX_XX_COMBINED_ENGLISH"
>
>
>
>
>
> Dim parameter As New OracleParameter
>
> parameter.ParameterName =
"oXML_STRING"
>
> parameter.OracleType =
OracleType.VarChar
>
> parameter.Size = 10000
>
> parameter.Direction =
ParameterDirection.Output
>
>
>
> .Parameters.Add(parameter)
>
>
>
> End With
>
> IObject =
ObjectCreator.CreateObject("PQS",
"Factory")
>
> Quote_InitialRequest = IObject.GetList(cmd)
>
>
>
> 'Write to Trace if Enabled
>
> ServiceHelper.RoutineEnd(Debug)
>
>
>
> Catch ex As Exception
>
> Throw
>
> End Try
>
>
>
>
>
> The GetList Method of the factory looks like this:
>
> Imports Microsoft.Practices.EnterpriseLibrary.Data
>
> ...
>
>
>
> Public Function GetList(ByVal cmd As
> System.Data.OracleClient.OracleCommand) As
System.Data.DataSet
> Implements ICommonFactory.GetList
>
> Dim db As Database =
>
DatabaseFactory.CreateDatabase(System.Configuration.Configur
ationSetting
> s.AppSettings("PQS"), "Common")
>
>
db.ExecuteNonQuery(CommonCmdWrapper.PrepareCommand(db, cmd))
>
> Dim myData As New DataSet
>
> GetList = CType(cmd.Parameters(2).Value,
System.Data.DataSet)
>
> End Function
>
>
>
> The exception is thrown in the lne db.ExecuteNonQuery
and the exception
> message is as follows:
>
>
>
> Message "ORA-06502: PL/SQL:
numeric or value
> error: character string buffer too small
>
> ORA-06512: at "PAYOUT.WEB", line 990
>
> ORA-06502: PL/SQL: numeric or value error: character
string buffer too
> small
>
> ORA-06512: at line 1
>
> " String
>
>
>
>
>
> The stack trace is as follows:
>
> StackTrace " at
>
System.Data.OracleClient.OracleConnection.CheckError(OciErro
rHandle
> errorHandle, Int32 rc)
>
> at
System.Data.OracleClient.OracleCommand.Execute(OciHandle
> statementHandle, CommandBehavior behavior, Boolean
isReader, Boolean
> needRowid, OciHandle& rowidDescriptor,
ArrayList&
> refCursorParameterOrdinals)
>
> at
System.Data.OracleClient.OracleCommand.Execute(OciHandle
> statementHandle, CommandBehavior behavior, Boolean
needRowid, OciHandle&
> rowidDescriptor)
>
> at
>
System.Data.OracleClient.OracleCommand.ExecuteNonQueryIntern
al(Boolean
> needRowid, OciHandle& rowidDescriptor)
>
> at
System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
>
> at
>
Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecut
eNonQuery(DB
> CommandWrapper command)
>
> at
>
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteN
onQuery(DBCo
> mmandWrapper command)
>
> at
>
CIT.EAI.CS.ECS.OracleObjectFactory.PQSFactory.GetList(Oracle
Command cmd)
> in
C:\CIT.EAI.CS.ECS.OracleObjectFactory\PQSDEV\PQSFactory.v
b:line 27
>
> at
QuoteSystem.QuoteSystem.Quote_InitialRequest(String
ContractNo,
> String TemplateName, String BuyOutType, Boolean Debug)
in
>
c:\inetpub\wwwroot\QuoteSystem\QuoteSystem.asmx.vb:line
90"
> String
>
>
>
>
>
> No matter how much I increase the size of the varchars
I always have the
> same error.
>
> I executed the Oracle command in SQL Navigator and it
only returns the
> ORA-06502: PL/SQL: numeric or value error: character
string buffer too
> small when the output parameter has a size smaller than
2000.
>
>
>
> The CommonCmdWrapper is part of the
> Microsoft.Practices.EnterpriseLibrary.Data and it seems
to be the layer
> causing the problem.
>
>
>
> Any idea or where to look up for this error is more
than welcome. Oracle
> server is version 9i.
>
>
>
> When using only the System.Data.OracleClient namespace,
the call goes
> through without problems:
>
>
>
> Here I put an example with a ConnectionString hard
coded.:
>
>
>
> Dim cmd As New OracleClient.OracleCommand
>
> Try
>
> 'Write to Trace if Enabled
>
> ServiceHelper.RoutineBegin(Debug)
>
>
>
> cmd.CommandText =
"web.sp_web_quote_request2"
>
> cmd.CommandType =
CommandType.StoredProcedure
>
> With cmd
>
>
>
>
.Parameters.Add("iCONTRACT_NO",
> OracleType.VarChar).Value =
"333-3333333-333"
>
>
.Parameters.Add("iTEMPLATE_NAME",
> OracleType.VarChar).Value =
"XXX_XX_COMBINED_ENGLISH"
>
>
>
>
>
> Dim parameter As New OracleParameter
>
> parameter.ParameterName =
"oXML_STRING"
>
> parameter.OracleType =
OracleType.VarChar
>
> parameter.Size = 10000
>
> parameter.Direction =
ParameterDirection.Output
>
>
>
> .Parameters.Add(parameter)
>
>
>
> End With
>
>
>
> Dim cnn As New OracleConnection("Data
Source=PQSDEV;User
> Id=XXX;Password=XXX;Integrated Security=no;")
>
> cnn.Open()
>
> cmd.Connection = cnn
>
> cmd.Prepare()
>
> cmd.ExecuteNonQuery()
>
> cnn.Close()
>
> ' IObject =
ObjectCreator.CreateObject("PQS",
"Factory")
>
> ' Quote_InitialRequest =
IObject.GetList(cmd)
>
>
>
> 'Write to Trace if Enabled
>
> ServiceHelper.RoutineEnd(Debug)
>
>
>
> Catch ex As Exception
>
> Throw
>
>
>
> End Try
>
>
>
> Thanks in advance,
>
>
>
>
>
> Lizet Pena
>
>
>
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|