Call an Oracle Stored Procedure from .NET using OraDirect
Posted: Tue 13 Jun 2006 23:18
Hi,
I am trying to call an oracle stored procedure that takes a number as a parameter. From the .NET code I do the following -
subscriberResults.CommandType = System.Data.CommandType.StoredProcedure;
subscriberResults.CommandText = "extend_billing.billing_results_pkg.create_all_subscriber_charges";
subscriberResults.Connection = oraConnection;
subscriberResults.Name = "createAllSubscriberCharges";
MessageBox.Show(billingPeriod.SelectedValue.ToString(), "Billing Period No.");
subscriberResults.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CURRENT_PERIOD_NO", CoreLab.Oracle.OracleDbType.Number, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, ((OracleNumber)billingPeriod.SelectedValue.ToString()))));
oraConnection.Open();
subscriberResults.ExecuteNonQuery();
oraConnection.Close();
The problem that occurs is that Oracle cannot find the procedure being called, I suspect this is due to the parameter type that I am passing in not being correct.
What do I use for an Oracle Number in .NET?
Regards,
Scott.
I am trying to call an oracle stored procedure that takes a number as a parameter. From the .NET code I do the following -
subscriberResults.CommandType = System.Data.CommandType.StoredProcedure;
subscriberResults.CommandText = "extend_billing.billing_results_pkg.create_all_subscriber_charges";
subscriberResults.Connection = oraConnection;
subscriberResults.Name = "createAllSubscriberCharges";
MessageBox.Show(billingPeriod.SelectedValue.ToString(), "Billing Period No.");
subscriberResults.Parameters.Add(new CoreLab.Oracle.OracleParameter("P_CURRENT_PERIOD_NO", CoreLab.Oracle.OracleDbType.Number, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, ((OracleNumber)billingPeriod.SelectedValue.ToString()))));
oraConnection.Open();
subscriberResults.ExecuteNonQuery();
oraConnection.Close();
The problem that occurs is that Oracle cannot find the procedure being called, I suspect this is due to the parameter type that I am passing in not being correct.
What do I use for an Oracle Number in .NET?
Regards,
Scott.