为什么我无法执行存储过程? (OracleException 被捕获)

发布于 2024-10-15 03:16:59 字数 895 浏览 5 评论 0原文

这是连接到 Oracle 数据库的代码。它在最后一行失败: 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.Fill(dtResult);

错误是“OracleRxception 被捕获:

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

我可以通过 Oracle SQL*Plus 访问数据库。为什么我会收到此错误?数据库端是否缺少存储过程,还是我的代码?关于如何解决此问题的任何想法?

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.Fill(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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

温折酒 2024-10-22 03:16:59

您可能需要在命令文本中定义schema.package.storedprocedure(或schema.table)

而不是:

select * from table

使用:

select * from schema.table

...这同样适用于函数/存储过程

如果您的 commandText 仅包含存储过程:

storedprocedurename

尝试:

schema.package.storedprocedurename

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
‘画卷フ 2024-10-22 03:16:59

另外,您可能想使用公共同义词。为对象创建公共同义词通常是比显式使用所有者/模式方法更好的方法。使用这种方法,这些对象的用户不需要担心 schema.someObject 表示法。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文