The underscore (_) wildcard character  The caret (^) wildcard character

Chapter 4: Expressions, Identifiers, and Wildcard Characters

Bracketed ([ ]) characters

Use brackets to enclose a range of characters, such as [a-f], or a set of characters such as [a2Br]. When ranges are used, all values in the sort order between (and including) rangespec1 and rangespec2 are returned. For example, “[0-z” matches 0-9, A-Z and a-z (and several punctuation characters) in 7-bit ASCII.

To find names ending with “inger” and beginning with any single character between M and Z:

select au_lname 
from authors 
where au_lname like "[M-Z]inger"

To find both “DeFrance” and “deFrance”:

select au_lname 
from authors 
where au_lname like "[dD]eFrance"

When using bracketed identifiers to create objects, such as with create table [table_name] or create dstabase [dbname], you must include at least one valid character.

All trailing spaces within bracketed identifiers are removed from the object name. For example, you achieve the same results executing the following create table commands:

This rule applies to all objects you can create using bracketed identifiers.





Copyright © 2005. Sybase Inc. All rights reserved. The caret (^) wildcard character

View this book as PDF