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!

How to call PL/SQLProcedure form C#

736358Feb 23 2012 — edited Feb 29 2012
Just need a simple C# method to execute a PL/SQL SP (Stored Procedure). I'm getting a recursion error, however my table is only 50 rows. I am able to execute the SP in TOAD perfectly, it takes about 1 second to process. I don't require parameter return values.

OracleCommand cmd = new OracleCommand();
cmd.Connection = connection;

cmd.CommandText = "HDWSTG_ADMIN.SI_MASTER_UPDATE_SP2";
cmd.CommandType = CommandType.StoredProcedure;

//cmd.Parameters.Add("reccount", OracleType.Number);
//cmd.Parameters["reccount"].Direction = ParameterDirection.Output;

cmd.ExecuteNonQuery();
//cmd.ExecuteOracleNonQuery();
connection.Close();

Console.WriteLine(cmd.Parameters["reccount"].Value);


Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2012
Added on Feb 23 2012
3 comments
3,743 views