PATTERN: Generating a Pattern From a String

How to:

The PATTERN function examines a source string and produces a pattern that indicates the sequence of numbers, uppercase letters, and lowercase letters in the source string. This function is useful for examining data to make sure that it follows a standard pattern.

In the output pattern:


Top of page

x
Syntax: How to Generate a Pattern From an Input String
PATTERN (length, source_string,  output)

where:

length

Numeric

Is the length of source_string.

source_string

Alphanumeric

Is the source string.

output

Alphanumeric



Example: Producing a Pattern From Alphanumeric Data

PATTERN generates a pattern for each instance of TESTFLD. The result is stored in a column with the format A14:

PATTERN (14, TESTFLD, 'A14' )

For 212-736-6250, the result is 999-999-9999.

For 800-969-INFO, the result is 1999-999-AAAA.


iWay Software