Search code examples
c#.netoracle-databaseora-06550

Running Oracle stored procs from C#


A beginner question: I have a stored proc (just a procedure, without any packages) in the Oracle Database:

CREATE OR REPLACE procedure FII_DBO.CLEAR_UNIT_TEST_PRODUCT
IS
BEGIN
 ...
END CLEAR_UNIT_TEST_PRODUCT;

and it works fine in TOAD. However, when I try to run it from C# it complains:

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'CLEAR_UNIT_TEST_PRODUCT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

relevant C# code:

Command = new OracleCommand();
Command.CommandText = procedureName;
Command.CommandType = CommandType.StoredProcedure;
Command.Connection = connection;
Command.ExecuteNonQuery();

Solution

  • Check that the Oracle user that your .NET application is connecting with has permissions to execute the stored procedure.