how to increase sqlplus column output length?

后端 未结 10 2074
萌比男神i
萌比男神i 2021-01-30 12:45

I have some queries to find out the ddl of some objects from a schema. The result columns I am getting are truncated in the middle of the queries.

How can I increase the

相关标签:
10条回答
  • 2021-01-30 12:55

    On Linux try these:

    set wrap off
    set trimout ON
    set trimspool on
    set serveroutput on
    set pagesize 0
    set long 20000000
    set longchunksize 20000000
    set linesize 4000
    
    0 讨论(0)
  • 2021-01-30 12:56

    On Windows you may try this:

    • right-click in the sqlplus window
    • select properties ->layout
    • increase screen buffer size width to 1000
    0 讨论(0)
  • 2021-01-30 12:59

    This configuration is working for me:

    set termout off
    set verify off
    set trimspool on
    set linesize 200
    set longchunksize 200000
    set long 200000
    set pages 0
    column txt format a120
    

    The column format definition with the linesize option helped to avoid the truncation at 80 chars.

    0 讨论(0)
  • 2021-01-30 12:59

    This worked like a charm for me with a CLOB column:

    set long 20000000
    set linesize 32767
    column YOUR_COLUMN_NAME format a32767
    select YOUR_COLUMN_NAME from YOUR_TABLE;
    
    0 讨论(0)
  • 2021-01-30 13:01

    I've just used the following command:

    SET LIN[ESIZE] 200
    

    (from http://ss64.com/ora/syntax-sqlplus-set.html).

    EDIT: For clarity, valid commands are SET LIN 200 or SET LINESIZE 200.

    This works fine, but you have to ensure your console window is wide enough. If you're using SQL Plus direct from MS Windows Command Prompt, the console window will automatically wrap the line at whatever the "Screen Buffer Size Width" property is set to, regardless of any SQL Plus LINESIZE specification.

    As suggested by @simplyharsh, you can also configure individual columns to display set widths, using COLUMN col_name FORMAT Ax (where x is the desired length, in characters) - this is useful if you have one or two extra large columns and you just wish to show a summary of their values in the console screen.

    0 讨论(0)
  • 2021-01-30 13:07

    Additionally to setting the LINESIZE, as LordScree suggested, you could also specify to output to a file, to overcome the problem with the console width. Here's how I do it:

    set linesize 15000;
    spool myoutput.txt;
    SELECT 
    ...
    spool off;
    
    0 讨论(0)
提交回复
热议问题