Re: select statement syntax for tapes used by a node
2003-05-07 16:15:55
- I don't think you can get a total in the same command that lists the
individual volumes; you'd need another command for that (there was a
similar thread in the last week or so that dealt with getting counts).
- Yes, the DISTINCT keyword will give you unique volume names
- You can wildcard your search with LIKE instead of '=' and with
pattern-matching characters. In SQL, the underscore '_' character matches
exactly one character, and the per cent '%' character matches zero or more
characters, so you can code a WHERE clause like this:
WHERE STGPOOL_NAME LIKE 'TAPE%'
to find all instances where the storage pool name begins with TAPE.
Regards,
Andy
Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.eyebm DOT com (change eye to i to reply)
The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.
Joni Moyer <joni.moyer AT HIGHMARK DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
05/07/2003 12:09
Please respond to "ADSM: Dist Stor Manager"
To: ADSM-L AT VM.MARIST DOT EDU
cc:
Subject: select statement syntax for tapes used by a node
Hello everyone!
Quick question to all of you SQL experts. I want to find all offsite
tapes
associated with a certain node. I already have the following select
statement. I was wondering if it is possible to get a listing of all of
the tapes and at the bottom of this have a total? Also, is it possible to
have a wildcard for the storage pool name? Some of the nodes may be on
multiple offsite tape pools and I was just wondering if there would be an
easier way of doing this? For example, all of my offsite tape pools begin
with tapecopy... is masking possible or do I just need to run multiple
selects.
select volume_name,node_name from volumeusage where node_name='XXXXXXX'
and
stgpool_name='XXXXXXX' order by volume_name,node_name
If I put the word distinct in front of volume_name, will that just list
each tape once?
Thank you all so much in advance!!!!
Joni Moyer
Systems Programmer
joni.moyer AT highmark DOT com
(717)975-8338
|
|
|