Siebel Developer's Reference > Operators and Expressions > Operators >

LIKE and NOT LIKE Operators


The LIKE operator matches a portion of one character value to another value. Siebel CRM uses the following format for a LIKE operator in a character string comparison that uses pattern matching:

char1 LIKE char2

where:

  • char1 is the value that Siebel CRM compares to the pattern.
  • char2 is the pattern where Siebel CRM compares char1.

To exclude a pattern, you can use the NOT logical operator with the LIKE operator. It uses the following format:

char1 NOT LIKE char2

or

NOT (char1 LIKE char2)

Each character is case-sensitive.

The NOT operator requires parentheses.

The Search Engine Table property of a view or applet must reference the same table that the index references. For example, if the search index references the S_EVT_ACT table, then the view and the applet must reference the Action business component.

Wildcard Characters You Can Use with the LIKE Operator

Table 207 describes wildcard characters that you can use with the LIKE operator.

Table 207. Wildcard Characters You Can Use with the LIKE Operator
Character
Description

*

Replace zero or more characters.

For example:

[Last Name] LIKE "Sm*"

This example returns all records whose last name starts with Sm. For example, Smith, Smythe, Smart, and so on.

For example:

[Last Name] LIKE "*om*"

This example returns all records whose Last Name field includes om. For example, Thomas, Thompson, Tomlin, and so on.

Using the * (asterisk) wildcard to find all entries in a field might cause a performance problem. If it does, then you can use IS NOT NULL instead. For more information, see NULL Operator.

?

Replace one character.

For example:

[First Name] NOT LIKE "Da?"

This example returns all records whose first name is three characters long and does not start with the letters Da. For example, it returns records that include Ted, Tom, and Sam. It does not return records that start with Dax or Dan.

For example:

NOT ([First Name] LIKE "?o?")

This example returns all records whose first name is three characters long and does not include o as the middle character. For example, it returns Ted and Sam. It does not return Tom or Bob.

Siebel Developer's Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.