Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Column Headers being truncated

    Oracle SQLPlus Worksheet
    When I run an SQLPlus query, the displayed width of each column is the width of the data item. This means that the column header for many fields is truncated. How do I override this default width in order to make the entire column header appear without being truncated. An example is below. The last column is titled DESTINATION, but only DES shows.

    BAG_TAG_N ORI DES
    --------- --- ---
    3UA233468 TUL ORD
    3UA233468 AVP ORD
    3UA233468 ORD MLI

  2. #2
    Join Date
    Jan 2004
    Location
    Scottsdale, AZ
    Posts
    106
    "Take Control!
    Make The Choice!
    Accept The Consequences!
    Deal With The Results! "

  3. #3
    Join Date
    Mar 2004
    Posts
    4
    Thanks for the reply, but I could not find what I was looking for. I actually had seen that documentation during my Google search on this subject. I do understand how to change the column width for individual columns, on a column by column basis. My question is whether it is possible to issue one single command that will set the column width to the wider of either the column header or the column data. Any ideas?

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    col column_name format a(add your size here)

    example:
    PHP Code:
    15:14:39 prod_copy@kod1col org_id format a4
    15
    :14:59 prod_copy@kod1select distinct org_id from customer;

    ORG_
    ----
    4
    DW
    ENS
    NHL
    NU
    SOS
    VER
    VRB

    8 rows selected
    .

    Elapsed00:00:00.00
    15
    :15:09 prod_copy@kod1col org_id format a6
    15
    :15:28 prod_copy@kod1> /

    ORG_ID
    ------
    4
    DW
    ENS
    NHL
    NU
    SOS
    VER
    VRB 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  5. #5
    Join Date
    Mar 2004
    Posts
    4
    Duck. Thanks for your reply. I probably did a poor job of explaining. An example will help. Let's say I have a query that displays 25 columns. Does Oracle have a way to automatically set the width of ALL the columns with a SINGLE command so that the column header will not be truncated for all 25 columns?

  6. #6
    Join Date
    Jul 2003
    Posts
    2,296
    no, you need to either:

    1. write some dynamic sql to change all of your
    column formats
    2. set all the columns up before you run the query
    3. store all your formats in your glogin.sql file so
    they always load everytime you start sql*plus
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •