Kasper Hansen Kasper Hansen - 1 year ago 74
C# Question

Why can't I execute the stored procedure? (OracleException was caught)

This is code to connect to an Oracle database. It fails at the last line: dbDataAdapter.Fill(dtResult);

private object Execute(CommandType commandType, Common.DATA.SqlCommonExecutionType sqlCommonExecutionType, DbCommand dbCommand)

dbc = dbConnection.CreateCommand();
dbc.CommandType = commandType;
dbc.CommandText = dbCommand.CommandText;
dbc.CommandTimeout = 3600;

if (dbc.Connection.State == ConnectionState.Closed)

DataTable dtResult = new DataTable();
DbDataAdapter dbDataAdapter = dbProviderFactory.CreateDataAdapter();
dbDataAdapter.SelectCommand = dbc;

The error is "OracleRxception was caught:

ORA-06550: line 1, column 7:
PLS-00201: identifier 'RESETUNFINISHEDJOBS' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

I have access to the database through Oracle SQL*Plus. Why am I getting this error? Is the stored procedure missing on the database side or is it my code? Any ideas of how to solve this?

Answer Source

You may need to define schema.package.storedprocedure (or schema.table) in your commandtext

Instead of:

select * from table


select * from schema.table

... and the same applies for functions/stored procedures

If your commandText contains just the stored procedure:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download