oracle sqlplus 包装结果
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10499544/
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
oracle sqlplus wrapping results
提问by john
When I run a query like:
当我运行如下查询时:
SELECT * FROM CAR;
the results appear but each row wraps to several lines.
结果出现,但每一行都换行成几行。
How can I stop this wrapping so that each row appears on a single line?
我怎样才能停止这种换行,以便每一行都出现在一行上?
回答by Guillaume
Had the same problem, even after changing set lines
to a big number:
有同样的问题,即使在更改set lines
为一个大数字后:
select * from dba_directories;
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
---------------------------------------------------------------------------------------------------------------------------------------------------------------
SYS DPUMP_DIR
C:\xxx
SYS CLEAN_PUMP_DIR
D:\yyy
SYS TCMCLEAN_DPUMP_DIR
C:\zzz
The way to do it was to use also: set wrap off
这样做的方法是也使用: set wrap off
OWNER DIRECTORY_NAME DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------------------
SYS DPUMP_DIR C:\xxx
SYS CLEAN_PUMP_DIR D:\yyy
SYS TCMCLEAN_DPUMP_DIR C:\zzz
回答by Alex Poole
Really hard to tell quite what the question actually is; but if you're seeing each row of data wrapped onto multiple lines in SQL*Plus, you need to do set lines 180
or similar; the number you use would ideally be the width of your terminal. The default is 80. You can go wider than the terminal, and it will still wrap, but you may find it easier to read still.
真的很难说清楚问题究竟是什么;但是,如果您在 SQL*Plus 中看到每一行数据都包含在多行中,则需要执行set lines 180
或类似操作;您使用的数字最好是终端的宽度。默认值为 80。你可以比终端更宽,它仍然会换行,但你可能会发现它仍然更容易阅读。
The documentation for all the set
commands is here.
所有set
命令的文档都在这里。
回答by steve
This is probably to do with the wrap of the text. I have completed this with my tables and it works:
这可能与文本的换行有关。我已经用我的表完成了这个并且它有效:
SQL> set wrap off;
SQL> 设置换行;
回答by Rene
Are you talking about SQLplus? If so try setting the column format. This webpage gives an example: http://www.adp-gmbh.ch/ora/sqlplus/beautify.html
你在谈论 SQLplus 吗?如果是这样,请尝试设置列格式。这个网页给出了一个例子:http: //www.adp-gmbh.ch/ora/sqlplus/beautify.html