ADSM-L

[ADSM-L] SELECT statements and column widths

2013-04-16 16:28:01
Subject: [ADSM-L] SELECT statements and column widths
From: Neil Schofield <neil.schofield AT YORKSHIREWATER.CO DOT UK>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 16 Apr 2013 21:25:56 +0100
I'm in the throes of an upgrade from TSM Server 5.5 to 6.3 and have had a
bit of a problem re-writing some of our custom SQL scripts. I was wondering
if anyone can point out what I'm doing wrong.

I understand that to get the select statements to return a table format
instead of a list format I need to use the cast function to restrict the
column width - this article explains the theory:
http://www-01.ibm.com/support/docview.wss?uid=swg21502715

The problem I have is that it doesn't work on any table which has
FILESPACE_NAME as a column - eg occupancy, filespaces, volumeusage, etc.
Whenever I do a SELECT CAST(FILESPACE_NAME AS CHAR(n)), I get the
filespace_name truncated to n characters (good) but in a column that is 2 x
n characters wide (bad). Other fields in the same tables with the same data
type - ie VARCHAR - do not suffer the same effect and it's got me stumped.

In the example below, does anyone have any idea how I can shrink the size
of the second column to match the width of the data in it?,

tsm: xxxxxxx>select cast(node_name as CHAR(15)) as Node,cast(filespace_name
as CHAR(15)) as FS,cast(volume_name as CHAR(8)) as Volume from volumeusage

NODE                 FS                                  VOLUME
----------------     -------------------------------     ---------
xxxxxxx              \\xxxxxxxxxx\x$                     xxxxxx
...

TSM Server is v6.3.3.1 running on Windows Server 2008 R2. Admin client is
6.4.0.1.

Regards
Neil Schofield
Technical Leader.
Yorkshire Water


 ----------------------------------------

Spotted a leak?
If you spot a leak please report it immediately. Call us on 0800 57 3553 or go 
to http://www.yorkshirewater.com/leaks

Get a free water saving pack
Don't forget to request your free water and energy saving pack, it could save 
you money on your utility bills and help you conserve water. 
http://www.yorkshirewater.com/savewater

The information in this e-mail is confidential and may also be legally 
privileged. The contents are intended for recipient only and are subject to the 
legal notice available at http://www.keldagroup.com/email.htm
Yorkshire Water Services Limited
Registered Office Western House, Halifax Road, Bradford, BD6 2SZ
Registered in England and Wales No 2366682

<Prev in Thread] Current Thread [Next in Thread>