代码改变世界

How to make sqlplus output appear in one line

2023-07-26 09:31  jetwill  阅读(63)  评论(0编辑  收藏  举报

How to make sqlplus output appear in one line

https://dba.stackexchange.com/questions/54149/how-to-make-sqlplus-output-appear-in-one-line
# SQL*Plus User's Guide and Reference
http://docs.oracle.com/cd/E16655_01/server.121/e18404/ch_twelve040.htm#BACGAJIC


SET LINESIZE linesize   
-- linesize can be 1 through 32767

The following sqlplus commands maybe usefull:

SET LINESIZE linesize the length of the line. In most cases the maximum value for linesize is 32767. You can find out your maximum value if you set LINESIZE to an invalid value and check the error message so SET LINESIZE 0 may give SP2-0267: linesize option 0 out of range (1 through 32767) (1)
SET TRIMSPOOL ON otherwise every line in the spoolfile is filled up with blanks until the linesize is reached.
SET TRIMOUT ON otherwise every line in the output is filled up with blanks until the linesize is reached.
SET WRAP OFF Truncates the line if its is longer then LINESIZE. This should not happen if linesize is large enough.
SET TERMOUT OFF suppresses the printing of the results to the output. The lines are still written to the spool file. This may accelerate the exectution time of a statement a lot.
SET PAGESIZE 0 to set an infinite pagesize and avoid headings , titles and so on.
There are some other SET parameters concerning output (NUMWIDTH, NUMFORMAT, LONG, COLSEP) and performance (ARRAYSIZE, LONGCHUNKSIZE).

CHR(13) for CR (Carriage Return), CHR(10) for LF: Line Feed

CHR(13) CR \r
CH(10) LF \n

User || to connect String in PLSQL