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!
Khoi Nguyen - November 12, 2024

I copy and paste the example above to my filter. I replace  ENAME with my data element Name. It gives me the same error whenever I try SQL_LIKE command

TE_7002 Transformation stopped due to a fatal error in the mapping. The expression [SQL_LIKE(Name, 'A_#%', '#')] contains the following errors [<> [SQL_LIKE(Name, 'A_#%', '#')]: : invalid function reference ... >>>>SQL_LIKE(Name, 'A_#%', '#')<<<<]. 

 Note: I validate and ger the message 'The expression is valid' before I run the mapping.

Please test the SQL_LIKE command again to make sure it works.

 
Informatica Documentation Team - November 13, 2024

Hi Khoi Nguyen,

We’re working to address your comments and will get back to you.