ADSM-L

Re: TSM SQL Script

2002-03-20 14:33:17
Subject: Re: TSM SQL Script
From: "William F. Colwell" <bcolwell AT DRAPER DOT COM>
Date: Wed, 20 Mar 2002 14:29:35 -0500
Jack - I think you should just remove the whole 'group by' clause.
You are not selecting a column function such has count(*) or avg(column).

Unless you have a very small database or a very fast machine,
this query will run a long time.

Hope this helps,

Bill

At 12:10 PM 3/20/2002 -0600, you wrote:
>Yep, I am an SQL newbie, but some help would be nice.
>The script at the bottom terminates with this message:
>  ANR2938E The column 'VOLUME_NAME' is not allowed in this context; it must
>either be named in the GROUP BY clause or be nested within an aggregate
>function.
>and points to the left(volume_name, 8) portion of the query.  I have played
>with it
>and still get this message.  Could someone please explain why this is
>occuring and
>how I can fix my script?
>
>TIA ... Jack
>
>/* Tape-Volumes */
>/* Listing is for all known nodes, and the tape volumes required to do a
>restore */
>set sqldatetimeformat i
>set sqldisplaymode w
>set sqlmathmode r
>commit
>select distinct copy_type, left(node_name, 12), -
>   left(volume_name, 8), left(stgpool_name, 16) -
>  from adsm.volumeusage  -
>  group by node_name, copy_type

----------
Bill Colwell
Bill Colwell
C. S. Draper Lab
Cambridge Ma.
<Prev in Thread] Current Thread [Next in Thread>