For "somevalue", use a partially qualified string surrounded by single
quotes. Pattern matching characters include '%', which means "0 or more
characters", and '_', which means exactly one character. Examples:

Match all strings beginning with ABC:

   like 'ABC%'

Match all strings ending in XYZ:

   like '%XYZ'

Match all strings containing LMN:

   like '%LMN%'

Match all strings beginning with ABC and ending with Z:

   like 'ABC%Z'

Match all strings beginning with ABC that are exactly 4 characters long:

   like 'ABC_'

etc.

Note that SQL string comparisons are case sensitive. For example, if you
want to find all node names that begin with MICHELLE, then you need to
use:

   select node_name from nodes where node_name like 'MICHELLE%'

Since in TSM, all node names are in upper case. As a general rule, most of
the TSM strings are upper case except for things like file names, file
system names, and contact information.

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: [EMAIL PROTECTED] (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.




Michelle DeVault <[EMAIL PROTECTED]>
Sent by: "ADSM: Dist Stor Manager" <[EMAIL PROTECTED]>
08/13/2002 10:25
Please respond to "ADSM: Dist Stor Manager"


        To:     [EMAIL PROTECTED]
        cc:
        Subject:        syntax for using "like" in select statement?



I'm sure this has been answered before, I just can't
find it in the archived on adsm.org.

How can I use a "like" in a select statement?  I don't
know the value exactly, just know a portion of it.

ex.
select * from sometable where somecolumn like somevalue

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

Reply via email to