Db2 String Functions

This section introduces you to the Db2 string functions that help you manipulate character string data effectively.

FunctionDescription
CONCATConcatenate two strings into a single string.
INITCAPConvert a string to proper case or title case format.
INSERTInsert a substring into a string starting from a position and also deletes a substring specified by a length from the string.
INSTRReturn the position of the nth occurrence of a substring within a string.
LEFTExtract a substring that consists of the number of leftmost characters from a string.
LOCATEFind the position of the first occurrence of a string within another string
LOWERConvert a string to lowercase
LPADReturn a string that is padded on the left with the specified character, or with blanks.
LTRIMRemove specified string from the beginning of a string.
REPEATRepeat a string a number of times
REPLACEReplace all occurrence of a substring in a string with a new substring.
RIGHTExtract a substring that consists of the number of rightmost characters from a string.
RPADReturn a string that is padded on the right with the specified character, string, or with blanks.
RTRIMRemove specified characters from the end of a string.
SPACEReturn a character string that consists of a specified number of blanks.
SUBSTRINGExtract a substring with a specified length from a string.
TRANSLATEReturn a string in which one or more characters in a string are converted to other characters.
TRIMRemove blanks or another specified character from the end, the beginning, or both ends of a string expression.
UPPERConvert all characters of a string to uppercase.
Was this tutorial helpful ?