Teradata Tutorial on Teradata String Manipulation

teradata provides several functions to manipulate the strings. these functions are compatible with ansi standard.

sr.no string function & description
1

||

concatenates strings together

2

substr

extracts a portion of a string (teradata extension)

3

substring

extracts a portion of a string (ansi standard)

4

index

locates the position of a character in a string (teradata extension)

5

position

locates the position of a character in a string (ansi standard)

6

trim

trims blanks from a string

7

upper

converts a string to uppercase

8

lower

converts a string to lowercase

example

following table lists some of the string functions with the results.

string function result
select substring(‘warehouse’ from 1 for 4) ware
select substr(‘warehouse’,1,4) ware
select ‘data’ || ‘ ‘ || ‘warehouse’ data warehouse
select upper(‘data’) data
select lower(‘data’) data