Oracle DB 和 SQL 开发人员:“错误报告:执行完成但有警告” - 我如何*看到*警告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22835437/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 01:33:55  来源:igfitidea点击:

Oracle DB & SQL Developer: "Error report: execution completed with warning" - How do I *see* the warning?

sqloracleoracle-sqldeveloper

提问by Paul

I'm setting up a local oracle (11g) database - a clone of another database we have running already. I'm running a bunch of generated PL/SQL commands in SQL Developer.

我正在设置一个本地 oracle (11g) 数据库 - 我们已经运行的另一个数据库的克隆。我在 SQL Developer 中运行了一堆生成的 PL/SQL 命令。

I get the output

我得到输出

Error starting at line x in command: 
*long-ass SQL statement here* 
Error report: 
SQL Command: force view "someViewName"
Failed: Warning: execution completed with warning

How do I read the warning that has been generated without modifying the script?

如何在不修改脚本的情况下读取已生成的警告?

when I use the show errorsimmediately after this command, I get the output no errors

当我show errors在这个命令之后立即使用时,我得到输出 no errors

回答by Alex Poole

If show errorsdoesn't give you anything:

如果show errors没有给你任何东西:

select line, position, text
from user_errors
where type = 'VIEW'
and name = 'someViewName'
order by sequence;

That assumes you're creating it under your own schema; if not you can look in all_errorsinstead.

假设您是在自己的架构下创建它;如果没有,您可以查看all_errors

The columns are in the documentation:

这些列在文档中

ALL_ERRORSdescribes the current errors on the stored objects accessible to the current user.
DBA_ERRORSdescribes the current errors on all stored objects in the database.
USER_ERRORSdescribes the current errors on the stored objects owned by the current user. This view does not display the OWNERcolumn.

ALL_ERRORS描述当前用户可访问的存储对象上的当前错误。
DBA_ERRORS描述数据库中所有存储对象的当前错误。
USER_ERRORS描述当前用户拥有的存储对象上的当前错误。此视图不显示OWNER列。

回答by stephen meckstroth

The cause of the error is just simply forgetting your semi-colon at the end of your code. Or if it is PL/SQL you are forgetting your forward slash at the end.

错误的原因只是忘记了代码末尾的分号。或者,如果是 PL/SQL,您会忘记最后的正斜杠。