Forum Stats

  • 3,783,311 Users
  • 2,254,756 Discussions
  • 7,880,359 Comments

Discussions

SQLDeveloper is truncating the columns name

ClaudiaRaphaela-Oracle
ClaudiaRaphaela-Oracle Member Posts: 1
edited Jul 13, 2020 8:49AM in Social Groups

I installed SQLDeveloper (Version 19.4.0.354). When I run a simple SELECT-Statement

     select * from ps_person where emplid='KU0118';

as a script in SQL Developer (from the document+arrow icon, or F5) the output is:

pastedImage_2.png

The fifth till seventh column name (BIRTHPLACE, BIRTSTATE, DT_OF_DEATH) is truncated. Is there a SQLDeveloper setting which can be checked to prevent this?

Answers

  • KayK
    KayK Member Posts: 1,687 Bronze Crown
    edited Jul 6, 2020 10:09AM

    Hi 79,

    i expect it works the same way as in sql*plus.

    The length of the column-header depends on the length of column itself.

    I think BIRTHSTATE will be a 2-char column, right ?

    So try something like this before your select

         col BIRTHSTATE for a12

    and run the script.

    Have a  look at this https://docs.oracle.com/database/121/SQPUG/ch_six.htm#SQPUG016

    You will get more answers if you move your thread to this community

    regards
    Kay

    btw please choose a more readable name for your avatar. You're more than a number. Have a look at this: Update Your Community Display Name and Avatar!

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Jul 7, 2020 2:39AM

    If you run the SQL using Run Statement (Ctrl+Enter), the column headings in the query results grid will not be truncated. 

    Capture1.JPG

    When using Run Script (F5), there is a set sqlformat ansiconsole command that is meant to help with formatting ...

    Capture3.JPG

    but within SQL Developer it seems to have some column alignment issues versus set sqlformat default ...

    Capture2.JPG

    To see set sqlformat ansiconsole work correctly, you need to run it with the SQLcl command line, an alternate to SQL*Plus ...

    Capture4.JPG

    And just as @KayK suggests for SQL*Plus, you can also use the col command in SQLcl  and the SQL Developer worksheet.

    Cheers