There is no need to prase anything, just create more complex query
(without marrying the DBA, as per Wanda's advice :-)):
dsmadmc> select v.volume_name, -
(select library_name from libvolumes -
where libvolumes.volume_name=v.volume_name) -
as "in Library", -
(select home_element from libvolumes -
where libvolumes.volume_name=v.volume_name) -
as "at Element" -
from volumes v
Do not forget that plain select from libvolumes will not list only data
volumes but also scratches, dbbackups, exports, backupsets, etc. (all
volhistory tracked thingies).
Zlatko Krastev
IT Consultant
Dan Foster <[EMAIL PROTECTED]>
Sent by: "ADSM: Dist Stor Manager" <[EMAIL PROTECTED]>
06.01.2004 01:46
Please respond to "ADSM: Dist Stor Manager"
To: [EMAIL PROTECTED]
cc:
Subject: Re: List all tapes, highlighting those in library.
Hot Diggety! Deon George was rumored to have written:
> Has anybody got an SQL, that can list all VOLUMES, and highlight (either
> showing the element number or something) those that are in the library?
>
> This report would be useful to see quickly if a list of tapes are
already
> in the library - or which tapes in the list are not and need to be
checked
> in.
I got a list of tables by doing:
tsm> select tabnames,remarks from tables
Then I decided to look at the table called LIBVOLUMES because your request
is essentially the SQL equivalent of 'query libvolume'.
So then I decided to see what fields (columns) were present in the table
called 'LIBVOLUMES' with:
tsm: MYSERVER>select colname from columns where tabname='LIBVOLUMES'
COLNAME
------------------
LIBRARY_NAME
VOLUME_NAME
STATUS
OWNER
LAST_USE
HOME_ELEMENT
CLEANINGS_LEFT
Based on that, I figured only three columns might be useful. So:
tsm> select library_name,volume_name,home_element from libvolumes
...which would produce an output like:
tsm: MYSERVER>select library_name,volume_name,home_element from libvolumes
LIBRARY_NAME VOLUME_NAME HOME_ELEMENT
------------------ ------------------ ------------
3584LIB1 MYS000 1026
3584LIB1 MYS001 1027
3584LIB1 MYS002 1028
3584LIB1 MYS003 1029
3584LIB1 MYS004 1030
3584LIB1 MYS005 1031
[...snip...]
If you have only one library, you are free to leave the library_name off
the select query.
Parse the results as you like, regardless of if it's called via an
internal
TSM server-side script or if it's called via a script that parses the
output of calling dsmadmc in batch mode. It is trivial in either case.
-Dan