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!

Error: ORA-02074 when calling SP

389222Mar 4 2003 — edited Mar 5 2003
I'm writing a Web Service with VB.NET. One of the functions of the web service calls a Stored Procedure of oracle. I had made successfully functions before using ODP.NET but this time I'm getting the following error:

ORA-02074: cannot SET SAVEPOINT in a distributed transaction

I read that you have to disable the MTS but I couldn't find where.

Here's the code of my web service:

Dim connectionString As String = "Data Source=SERVPEB;User ID=USRPEB;Password=PEBUS"

'Connection to datasource, using connection parameters given above
Dim conn As New OracleConnection(connectionString)


'Open database connection
conn.Open()

Dim productCmd As New OracleCommand()

'Call 'getProductsInfo' stored procedure of 'ODPNet'
'database package
productCmd.CommandText = "SP_PE_PAGO"


'Step 2.//
'Set the command Type to Stored Procedure
productCmd.CommandType = CommandType.StoredProcedure

'Set the connection instance
productCmd.Connection = conn


'Step 3.//
'Bind the Ref Cursor parameters to the OracleCommand object
'for 'orderable' product status

productCmd.Parameters.Add("P_AccountNo", OracleDbType.Double, 10000, ParameterDirection.Input)
productCmd.Parameters.Add("P_Balance", OracleDbType.Double, 100, ParameterDirection.Input)
productCmd.Parameters.Add("P_TRANS_SOURCE", OracleDbType.Double, 70, ParameterDirection.Input)
productCmd.Parameters.Add("P_TRANS_TYPE", OracleDbType.Double, -170, ParameterDirection.Input)
productCmd.Parameters.Add("P_User", OracleDbType.Char, "prueba", ParameterDirection.Input)
productCmd.Parameters.Add("P_Currency", OracleDbType.Double, 1, ParameterDirection.Input)
productCmd.Parameters.Add("P_Date", OracleDbType.Varchar2, "3/3/03", ParameterDirection.Input)
productCmd.Parameters.Add("P_Process", OracleDbType.Double, 2, ParameterDirection.Input)

productCmd.Parameters.Add("P_Result", OracleDbType.Double, DBNull.Value, ParameterDirection.Output)

'Step 4.//
'Set the command for the Data Adapter
Dim productAdapter As New OracleDataAdapter(productCmd)

'Instantiate Data Set object
'conn.Open()
productCmd.ExecuteNonQuery()

conn.Close() 'Close the connection.
conn = Nothing



Thanks for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 2 2003
Added on Mar 4 2003
3 comments
413 views