Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions

Transformation Language Reference

Transformation Language Reference

SQL_LIKE

SQL_LIKE

Returns whether a value matches a regular expression pattern. This lets you validate date patterns, such as IDs, telephone numbers, postal codes, and state names.

Syntax

SQL_LIKE(subject, pattern, escape character)
The following table describes the arguments for this command:
Argument
Required/Optional
Description
subject
Required
String data type. Passes the value you want to match against the regular expression. Enclose the value in single quotation marks.
pattern
Required
String data type. Regular expression that you want to match. Enclose the pattern in single quotation marks.
escape character
Optional
String data type. The SQL_LIKE function supports the percentage sign (%) and underscore (_) as escape characters. Enclose the escape character in single quotation marks.

Return Value

TRUE if the data matches the pattern.
FALSE if the data does not match the pattern.
NULL if the input is a null value or if the pattern is NULL.

Example

You might use SQL_LIKE in an expression to find names that match a pattern. For example, the following expression matches names against the pattern "A_#%" with the escape character '#':
SQL_LIKE(ENAME, 'A_#%', '#')
ENAME
Value
SMITH
FALSE
AX%
TRUE
MILLER
FALSE
A%
FALSE
JONES
FALSE
BLAKE
FALSE
A%l
FALSE

0 COMMENTS

We’d like to hear from you!