Column Header is getting Truncated to 30 while Selecting from Dual (Doc ID 359055.1)

Last updated on OCTOBER 27, 2016

Applies to:

SQL*Plus - Version: 10.2.0.1
This problem can occur on any platform.

Symptoms

The column header is truncated to 30 characters when making a simple select of a text from dual table.
No error messages are returned.

The 9.2.x version of SQLPlus does not encounter the problem.

Steps to reproduce the issue:

SQL> alter system set "_adjust_literal_replacement"=true;
Then run the following query:
SQL> select 'TABLE : CUSTOMERDATA/CUSTOMERODER' from dual;
'TABLE:CUSTOMERDATA/CUSTOMER
---------------------------------
TABLE : CUSTOMERDATA/CUSTOMERODER

Notice that the header is truncated.

Then  checked in the same transaction:
SQL> select 'TABLE : CUSTOMERDATA/CUSTOMERODER' from dual;
'TABLE:CUSTOMERDATA/CUSTOME
---------------------------------
TABLE : CUSTOMERDATA/CUSTOMERODER

Notice that the literal string contains one extra space, which somehow influenced the header in that a letter is missing at the end.

Finally checked:
SQL> select 'TABLE:CUSTOMERDATA/CUSTOMERODER' from dual;
'TABLE:CUSTOMERDATA/CUSTOMEROD
---------------------------------
TABLE : CUSTOMERDATA/CUSTOMERODER

Removed the 2 spaces from the literal text, and this added 2 letters to the end of the header.
So somehow the header is influenced by the amount of white space in the literal text queried from the database.

This problem does not reproduce in 9.2.0.x. In 9.2 the header is displayed with exactly the same width as the data
queried.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms