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.
Call an Oracle Stored Procedure from .NET using OraDirect
-
- Posts: 21
- Joined: Tue 06 Jun 2006 03:14
- Location: Auckland, New Zealand
Code: Select all
subscriberResults.CommandText = "extend_billing.billing_results_pkg.create_all_subscriber_charges";
What is billingPeriod?
What is the full text of the error?
-
- Posts: 21
- Joined: Tue 06 Jun 2006 03:14
- Location: Auckland, New Zealand
Hi Alexey,
extend_billing is the schema, billing_results_pkg is the package and create_all_subscriber_charges is the procedure.
billingPeriod is a ComboBox with the value to pass into the stored procedure.
I will have to copy and paste the message into a reply tomorrow as I am not at work at the moment, but basically it is saying that the procedure create_all_subscriber_charges does not exist.
Cheers,
Scott.
extend_billing is the schema, billing_results_pkg is the package and create_all_subscriber_charges is the procedure.
billingPeriod is a ComboBox with the value to pass into the stored procedure.
I will have to copy and paste the message into a reply tomorrow as I am not at work at the moment, but basically it is saying that the procedure create_all_subscriber_charges does not exist.
Cheers,
Scott.
-
- Posts: 21
- Joined: Tue 06 Jun 2006 03:14
- Location: Auckland, New Zealand
Hi Alexey,
I have managed to get it to work by creating a test application and calling the create_all_subscriber_charges procedure. It was a copy and paste problem in the actual application, and what Oracle was telling me was correct that the stored procedure didn't exist, as I specified the wrong package.
The code I supplied was correct except for that small detail.
Cheers,
Scott.
I have managed to get it to work by creating a test application and calling the create_all_subscriber_charges procedure. It was a copy and paste problem in the actual application, and what Oracle was telling me was correct that the stored procedure didn't exist, as I specified the wrong package.
The code I supplied was correct except for that small detail.
Cheers,
Scott.