john
john

Reputation: 439

oracle sqlplus wrapping results

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?

Upvotes: 0

Views: 12672

Answers (4)

steve
steve

Reputation: 11

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;

Upvotes: 1

Guillaume
Guillaume

Reputation: 1879

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

Upvotes: 4

Alex Poole
Alex Poole

Reputation: 191235

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.

Upvotes: 3

Rene
Rene

Reputation: 10541

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

Upvotes: 1

Related Questions