开发者

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)
   dbc.Connection.Open();

DataTable dtResult = new DataTable();
DbDataAdapter dbDataAdapter = dbProviderFactory.CreateDataAdapter();
dbDataAdapter.SelectCommand = dbc;
dbDataAdapter.Fi开发者_开发知识库ll(dtResult);

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?


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

Instead of:

select * from table

Use:

select * from schema.table

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

If your commandText contains just the stored procedure:

storedprocedurename

Try:

schema.package.storedprocedurename


Also, you may want to use public synonyms. Its usually a better approach to create public synonyms for an object rather than explicitly using the owner/schema approach. The user of these objects shouldn't need worry about schema.someObject notation with this approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜