Results 1 to 5 of 5
  1. #1
    Senior Member GregE's Avatar
    Join Date
    May 2006
    Posts
    2,100
    Thanks
    9
    Thanked 17 Times in 16 Posts

    Default SQL - Adding a blank column

    Just a cosmetic question.

    Is there a way in SQL to add a blank column? Using Operational Reporting, I get a text email with two columns, but they're very close together.

    My command is:
    select node_name, sum(physical_mb) as TOTAL_MB from occupancy group by node_name order by 2 desc

    Running from TSM command line the spacing is fine, but in the text email the columns are close.

    Thanks!

  2. #2
    Moderator
    Join Date
    Sep 2002
    Location
    Indiana
    Posts
    2,560
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Add underscores to the column header "Total_MB" "__Total_MB__"

    This will force TSM to use a wider column size.

    -Aaron
    Three things are certain:
    Death, taxes, and lost data.
    Guess which has occurred.

  3. #3
    Senior Member GregE's Avatar
    Join Date
    May 2006
    Posts
    2,100
    Thanks
    9
    Thanked 17 Times in 16 Posts

    Default

    That expanded the header, but since the column is left-justified it didn't separate any differently. Is there a way to set that column to right-justify?

  4. #4
    Moderator
    Join Date
    Nov 2005
    Location
    Victoria, Australia
    Posts
    537
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by GregE View Post
    That expanded the header, but since the column is left-justified it didn't separate any differently. Is there a way to set that column to right-justify?
    yeap... use the right command.

    You can also use _'s as Aaron has stated or just blank spaces to expand a column width

    You could also add a ' ' in between the commands.

  5. #5
    Senior Member GregE's Avatar
    Join Date
    May 2006
    Posts
    2,100
    Thanks
    9
    Thanked 17 Times in 16 Posts

    Default

    Quote Originally Posted by mateinone View Post
    yeap... use the right command.

    You can also use _'s as Aaron has stated or just blank spaces to expand a column width

    You could also add a ' ' in between the commands.
    I didn't know I could do this, but just tried it. Very nice. Quick example of use if anyone needs to know. Use || to concatenate with something else, in this case a string of blanks. This will expand the column.

    SELECT n.node_name||'<insert spaces>' as NODE, n.platform_name as PLATFORM FROM nodes n.....
    ......etc etc.

Similar Threads

  1. Looking for blank LTO-4 labels
    By kfiresmith in forum Tape / Media Library
    Replies: 8
    Last Post: 09-24-2007, 02:04 PM
  2. Query Request: which SQL table and column?
    By Nicola in forum Scripting
    Replies: 2
    Last Post: 07-17-2007, 10:25 PM
  3. sql select and blank line in output?
    By Stephan in forum Scripting
    Replies: 0
    Last Post: 01-17-2007, 01:24 PM
  4. SUMMARY.SUCCESSFUL column
    By stenbs in forum Scripting
    Replies: 0
    Last Post: 09-17-2004, 01:58 PM
  5. Volume last use field blank
    By bheisser in forum Backup / Archive Discussion
    Replies: 1
    Last Post: 08-18-2004, 11:48 AM

Posting Permissions

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