oracle sqlplus wrapping results

99封情书 提交于 2019-12-19 04:55:58

问题


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?


回答1:


Had the same problem, even after changing set lines to a big number:

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

OWNER                          DIRECTORY_NAME                 DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------------------
SYS                            DPUMP_DIR                      C:\xxx
SYS                            CLEAN_PUMP_DIR                 D:\yyy
SYS                            TCMCLEAN_DPUMP_DIR             C:\zzz



回答2:


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.

The documentation for all the set commands is here.




回答3:


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




回答4:


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;



来源:https://stackoverflow.com/questions/10499544/oracle-sqlplus-wrapping-results

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!