为什么 Oracle Sql*Plus 打印许多不需要的标题?
当我运行一条应该返回精确一行的 sql 语句时,sqlplus 多次打印列名?为什么 ?
When I run a sql statement which supposed to return exact one row, sqlplus print column names many many times ? why ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能是因为由于换行,您的页面大小远小于显示数据所需的行数。它会在输出的每个“页面”上重复标题,即使它尚未完成显示一行。
为了查看/复制粘贴整个输出,请尝试
SET PAGESIZE 10000
(或其他一些大数字)。为了探索控制台中的输出,您可能希望将其设置为控制台窗口的高度(您猜对了 - 真正的“页面大小”)。这样,您将准确地看到一组标头,无论您所在的输出中的哪个位置 - 这正是此语句的目的。
密切相关的命令是
SET LINESIZE
- 输出宽度。Probably because your pagesize is much smaller than the number of lines necessary to display the data, due to wrapping. It repeats the heading on each "page" of output, even if it has not completed displaying a single row.
For the purpose of seeing/copy-pasting an entire output as a whole, try
SET PAGESIZE 10000
(or some other large number).For exploring the output in the console, you'd probably want to set it to your console window's height instead (you guessed it - the real "page size"). This way, you'll see exactly one set of headers, whichever place in the output you're in - which is exactly this statement's purpose.
A closely-related command is
SET LINESIZE
- output width.因为它的配置。您可以通过 SET 设置 sqlplus 行为:
http://ss64.com/ora/syntax- sqlplus-set.html
Because of its configuration. You can set sqlplus behaviour via SET:
http://ss64.com/ora/syntax-sqlplus-set.html