我怎样才能得到“ORA-00904::无效的标识符”?来自有效的包裹?

发布于 2024-10-12 09:57:37 字数 329 浏览 6 评论 0原文

我有一个有效的过程,其中有一条 insert..select 语句。现在,执行此过程会产生“ORA-00904::invalididentifier”错误。这在理论上怎么可能呢?没有触发器或动态 SQL。

此外,sqlerrm 中的 ORA-00904 文本没有指向 Oracle 认为无效的任何特定标识符的指针。

Oracle 版本 9.2.0.8

edit2:

事实证明,从该 select 中调用的函数存在问题(用常量替换它,一切正常)。可能这就是 ORA-00904 没有给出标识符的原因。尽管如此,问题仍然存在 - 没有动态 sql 的预编译代码怎么会给出这个错误?

I have a procedure that is valid and has in it an insert..select statement. Now there is a case where execution of this procedure produces "ORA-00904: : invalid identifier" error from this statement. How is that even theoretically possible? There are no triggers or dynamic SQL.

Also, the ORA-00904 text in sqlerrm is without pointer to any specific identifier that Oracle considers invalid.

Oracle version 9.2.0.8

edit2:

Turns out there was a problem with a function that was called from within that select (replaced it with constants and everything worked). Probably that was the reason that ORA-00904 did not give an identifier. Still, the question remains - how can that be that precompiled code with no dynamic sql gives this error?

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

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

发布评论

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

评论(2

追星践月 2024-10-19 09:57:37

我认为当您访问一个包,其中该包有效但主体需要编译并抛出异常时,可能会发生这种错误。

另一个原因可能是使用 authid current_user 的代码,它以当前用户的权限运行(不像正常情况下以拥有用户的权限运行)。当一个用户调用此类过程时可能会失败,而当由另一用户执行时可能会成功。

I think this kind of error might happen when you access a package where the package is valid but the body needs compilation and throws the exception.

Another reason might be code with authid current_user it runs with the privileges of the current user (not as normal with the privileges of the owning user). Such a procedure might fail when called with one and succeed when executed with another user.

送舟行 2024-10-19 09:57:37

既然您已经找到了解决方案,那么这不是您的问题。但我想添加一条注释,如果包函数有主体,但规格表中没有函数签名,则会出现此错误。

Since you already found the solution, this wasn't your problem. But I wanted to add a note, that you get this error if the package function has a body, but there's no function signature in the Spec sheet.

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