Oracle SQL*Plus 出现空行和多行注释错误
我正在尝试使用 SQL*Plus(命令行)执行查询,该查询是一个视图。 SQL*Plus 不支持换行或多行注释 ( /* -- */ )。
当我运行 set sqlblanklines on
时,它返回一个错误:
SQL> set sqlblanklines on
unknown SET option beginning "sqlblankli...".
因此我运行了“help set”,它表示 isql 不支持命令 sqlblanklines(带星号),但我正在使用 SQL *确实加上。
我不知道如何摆脱它,我这几天一直在煎熬我的大脑......
谢谢adv!
更多详细信息
版本是 8.0.6.0.0。
我正在从文件运行脚本。它显示了许多这样的错误:
SQL> start /tmp/sql/pti/APPS.DIBVWIP001.sql
错误就像
unknown command beginning "and msi.i..." - rest of line ignored.
unknown command beginning "and msi.o..." - rest of line ignored.
unknown command beginning "and bic.c..." - rest of line ignored.
unknown command beginning "and bbm.b..." - rest of line ignored.
For a list of known commands enter HELP and to leave enter EXIT.
在该块之前有一个空行.. 这就是重点。我无法从脚本中删除空行。
I'm trying to execute a query with SQL*Plus (command line) that is a VIEW. SQL*Plus isn't supporting new lines or multiline comments ( /* -- */ ).
When I run set sqlblanklines on
, it returns an error:
SQL> set sqlblanklines on
unknown SET option beginning "sqlblankli...".
So I ran 'help set' and it says that the command sqlblanklines (with an asterisk) is not supported by isql , but I'm using SQL*Plus indeed.
I don't know how to get rid of it, I've been frying my brain off about a couple days...
thanks in adv!!!
More details
The version is 8.0.6.0.0.
I'm running a script from a file. It shows many errors like this:
SQL> start /tmp/sql/pti/APPS.DIBVWIP001.sql
The errors are like
unknown command beginning "and msi.i..." - rest of line ignored.
unknown command beginning "and msi.o..." - rest of line ignored.
unknown command beginning "and bic.c..." - rest of line ignored.
unknown command beginning "and bbm.b..." - rest of line ignored.
For a list of known commands enter HELP and to leave enter EXIT.
Before that block there's an blank line.. that's the point. I can't remove the blank lines from the scripts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用该软件的古老版本。所以看现代版本的手册是没有好处的。如果您查阅Oracle 8.0.5 的 SQL*Plus 用户指南 你会发现SET不支持SQLBLANKLINES,这就是错误消息告诉你的。
我不确定为什么多行注释会让您感到悲伤:根据应该支持的文档。然而,SQL*Plus - 尤其是旧版本 - 对我们放置注释的位置很敏感。它不喜欢在 DDL 命令中放置得太早的注释。所以如果你正在做这样的事情……
你可能会遇到一些问题(尽管它在 11g 中运行良好)。
You are working with an ancient version of the software. So it's no good looking at a modern version of the manual. If you consult the SQL*Plus User's Guide for Oracle 8.0.5 you will discover that SET doesn't support SQLBLANKLINES, which is what the error message told you.
I'm not sure why the multi-line comments are giving you grief: according to the documentation that should be supported. However, SQL*Plus - especially older versions - is sensitive to where we place the comments. It doesn't like comments which are placed too early in the DDL command. So if you're doing something like this ...
... you might get some problems (although it runs fine in 11g).