ADSM-L

Re: [ADSM-L] SQL statement

2010-06-04 10:44:43
Subject: Re: [ADSM-L] SQL statement
From: "Loon, EJ van - SPLXM" <Eric-van.Loon AT KLM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 4 Jun 2010 16:43:12 +0200
Wow... Richard, respect!
This one works, you again saved my day!!!!
Here is the final working statement, so it's 'logged' on the ADSM-L
list:

select node_name, filespace_name, hl_name, ll_name from backups where
(upper(ll_name) like '%LOG%' or upper(ll_name) like '%ARCHIVE%' or
upper(ll_name) like '%DBDATA%' or upper(ll_name) like '%DBINDEX%' or
upper(ll_name) like '%DUMP%' or upper(ll_name) like '%AUDIT%') and
upper(hl_name) like '%ORA\_%' ESCAPE
'\' and node_name='KL100AT0'

Thank you VERY much!
Kind regards,
Eric van Loon
KLM Royal Dutch Airlines

-----Original Message-----
From: Richard Sims [mailto:rbs AT bu DOT edu] 
Sent: vrijdag 4 juni 2010 16:07
To: Loon, EJ van - SPLXM
Subject: Re: SQL statement

On Jun 4, 2010, at 9:23 AM, Loon, EJ van - SPLXM wrote:

> Hi Richard!
> Thanks, but still not what I expect, an example of one of the many
files
> returned:
> 
> KL100AT0,/home,/oracle/xt03js/,statspack_a064.log
> 
> Since I use upper(hl_name) like '%ORA_%' I would not expect a
> /oracle/xt03js/ in the list...

No, you wouldn't.  But...  :-)
Your thoughts are keyed on dealing with your site's directory name being
like  mount/data*/ora_*
where the architects decided to have an underscore in the name, which is
fine.
But you're now being defeated by that underscore because, in a Select
LIKE, an underscore is a wildcard for any single character!

An example of using this:
  select NODE_NAME, PLATFORM_NAME from NODES where upper(PLATFORM_NAME)
like 'LINUX__'
to report any Linux86 clients, versus LinuxPPC.

Unfortunately, TSM's Select does not conform to the standard that the
backslash char be an escape, to turn off the special meaning of the
underscore as in   like '%ORA\_%'
but, fortunately, it allows you to define an escape character, as in
    like '%ORA\_%'   ESCAPE '\'
So, mull that over, and give it a try.

Life is seldom simple.

    R.

********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************

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