Re: SELECT statements and column widths

2013-04-17 Thread Prather, Wanda
The difference is not in char vs substr vs cast, but in filespace_name vs node_name: tsm: LFTSM>select (substr(filespace_name,1,10)) as FS1, char(node_name,10) as NN1, cast(filespace_name as char(10)) as FS3 from filespaces FS1 NN1 FS3 -

Re: SELECT statements and column widths

2013-04-17 Thread Prather, Wanda
Well that is odd - I don't know why 2n+1, but at least I get consistent results: tsm: LFTSM>select (substr(filespace_name,1,10)) as FS1, char(filespace_name,10) as FS2, cast(filespace_name as char(10)) as FS3 from filespaces FS1 FS2 FS3 ---

Re: SELECT statements and column widths

2013-04-17 Thread Neil Schofield
Wanda > You can also do: > select substr(filespace_name,1,20) from filespaces > > and get only 20 chars back. Well that's interesting because it makes the problem worse! Using either CAST or SUBSTR truncate my data to N characters, but CAST gives me a column width of (N+1) for NODE_NAME and (2N+

Re: SELECT statements and column widths

2013-04-17 Thread Prather, Wanda
You can also do: select substr(filespace_name,1,20) from filespaces and get only 20 chars back. -Original Message- From: ADSM: Dist Stor Manager [mailto:ADSM-L@VM.MARIST.EDU] On Behalf Of Neil Schofield Sent: Wednesday, April 17, 2013 1:09 PM To: ADSM-L@VM.MARIST.EDU Subject: Re: [ADSM-

Re: SELECT statements and column widths

2013-04-17 Thread Thomas Denier
-Neil Schofield wrote: - >The fact that only the FILESPACE_NAME column is twice as wide as it >should be makes me wonder if it's a bug? It probably has something to do with the possible occurrence of Unicode characters outside the ASCII character set in filespace names. Thomas Denier Tho

Re: SELECT statements and column widths

2013-04-17 Thread Neil Schofield
Allen Thanks for the suggestion. The problem I've got is that the reports are the sort of ad-hoc SQL scripts that are run by administrators and operators from the admin client. While using '-comma' does reduce the column width, it is not appropriate in this scenario. The fact that only the FILESP

Re: SELECT statements and column widths

2013-04-17 Thread Allen S. Rout
On 04/16/2013 04:25 PM, Neil Schofield wrote: > 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 don't know from "do wrong"; but the way I appr

Re: SELECT statements and column widths

2013-04-16 Thread white jeff
Neil Had something similar, again with the filespace_name column To resolve, i do this: select char(filespace_name,20), etc On 16 April 2013 21:25, Neil Schofield wrote: > 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