Substring Function

The Substring Function returns a substring of the contents of the named column.

SUBSTR(columnname, start, [length])

columnname
Name of a character or binary column.
start
The position of the first character in the string.
length
The number of characters to use.

Example

If the PHONE_NUMBER column is defined as CHAR(10), you can use the Substring Function to map the area code. To obtain a substring of the first three positions of the phone number (area code) for the destination column, specify:

SUBSTR(PHONE_NUMBER, 1, 3)



Feedback