This section introduces you to the Db2 string functions that help you manipulate character string data effectively.
| Function | Description |
|---|---|
| CONCAT | Concatenate two strings into a single string. |
| INITCAP | Convert a string to proper case or title case format. |
| INSERT | Insert a substring into a string starting from a position and also deletes a substring specified by a length from the string. |
| INSTR | Return the position of the nth occurrence of a substring within a string. |
| LEFT | Extract a substring that consists of the number of leftmost characters from a string. |
| LOCATE | Find the position of the first occurrence of a string within another string |
| LOWER | Convert a string to lowercase |
| LPAD | Return a string that is padded on the left with the specified character, or with blanks. |
| LTRIM | Remove specified string from the beginning of a string. |
| REPEAT | Repeat a string a number of times |
| REPLACE | Replace all occurrence of a substring in a string with a new substring. |
| RIGHT | Extract a substring that consists of the number of rightmost characters from a string. |
| RPAD | Return a string that is padded on the right with the specified character, string, or with blanks. |
| RTRIM | Remove specified characters from the end of a string. |
| SPACE | Return a character string that consists of a specified number of blanks. |
| SUBSTRING | Extract a substring with a specified length from a string. |
| TRANSLATE | Return a string in which one or more characters in a string are converted to other characters. |
| TRIM | Remove blanks or another specified character from the end, the beginning, or both ends of a string expression. |
| UPPER | Convert all characters of a string to uppercase. |
Was this tutorial helpful ?