1

In SQL*Plus, when I set trimout off the display output disappears. This is unexpected.

Below is an example script that calls dbms_output.put_line once with trimout on and once with trimout off.

set serveroutput on size unlimited format wrapped
set trimout on
show trimout
show serveroutput
begin
  dbms_output.put_line(' hello world ');
end;
/

set trimout off
show trimout
show serveroutput
begin
  dbms_output.put_line(' hello world ');
end;
/

Below is the terminal output of the above example script.
Note: hello world is not displayed when trimout is off.

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 21 15:13:47 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected.

SQL>set serveroutput on size unlimited format wrapped
SQL>set trimout on
SQL>show trimout
trimout ON
SQL>show serveroutput
serveroutput ON SIZE UNLIMITED FORMAT WRAPPED
SQL>begin
  2    dbms_output.put_line(' hello world ');
  3  end;
  4  /
 hello world

PL/SQL procedure successfully completed.

SQL>
SQL>set trimout off
SQL>show trimout
trimout OFF
SQL>show serveroutput
serveroutput ON SIZE UNLIMITED FORMAT WRAPPED
SQL>begin
  2    dbms_output.put_line(' hello world ');
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL>

I was expecting hello world to be displayed when trimout is off as trimout controls

"...trailing blanks at the end of each displayed line"

SQL*Plus User's Guide and Reference 19c.

In both scenarios, the spool output shows the right trimmed hello word.

"TRIMOUT ON does not affect spooled output"

SQL*Plus User's Guide and Reference 19c.

How does one use trimout off while still displaying output in the terminal?

Using Windows 10 Enterprise.

Alex Bartsmon
  • 471
  • 4
  • 9

0 Answers0