BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
| |
 |
 |
 |
 |
 |
| SMS FAQ: Using Wildcards in SMS Queries |
 |
|
|
By: Cliff Hobbs
Posted On: 10/30/2001
We're all familiar with the "%" wildcard, but did you know about all the OTHER ones?
Check this out (from the Admin guide):
% (percent sign)Any string of zero or more characters. For example:Mo% searches for all names that begin with the letters mo (Mom, Morgan) %mo searches for all names that end with mo (Satchmo) %mo% searches for all names that include mo (Mom, Satchmo, tomorrow).
_ (underscore)Any single character. For example: _ill searches for any four-letter names ending with the letters ill (mill, Will)
[] (brackets)Any single character within the specified range. For example: [HD]an[eo]n searches for all names that begin with H or D, then an, then e or o, and then end with n (Hanson, Hansen, Danson, Dansen) [B-K]enson searches for all names ending with enson that begin with any single letter from B through K (Benson, Jenson)
[^] (caret)Any single character not within the specified range. For example: M[^c]% searches for all names beginning with the letter M that do not have the letter c as the second letter (MacPherson)
To use the %, _, [], or [^] characters as literal characters rather than as wildcard characters, do the following:
Use square brackets around the percent sign, the underscore, and the open bracket (that is, [%], [_], and [[]).
For example: 5[%] searches for 5% [_]n searches for _n [[] searches for [
Use the close bracket by itself. For example: ] searches for ]
Use the dash as the first character inside a set of square brackets. For example: [-acdf] searches for -,a,c,d, or f
Hot Tip from Tony Smith: When configuring the query for a specific machine, the operator is set to look for "machine name is equal to" this "variable".
When using wildcards this feature does not function properly. You must configure the query to look for all machines with "machine name is LIKE" (not equal to) this "variable". Otherwise it takes a long time to run and provides no return.
I'm sure most SMS Admin's could figure it out but having the instructions deal with wildcards and "equal to" and "is like" on the same sheet of paper may save someone time.
|
 |
 |
 |
|
|