Skip to main content
This following table describes the functions and operators for examining and manipulating string values (CHAR and VARCHAR data types). See Character types. Except where noted, these functions and operators are declared to accept and return type VARCHAR. Notes:
  1. Text comparison is case-sensitive (e.g: ‘Regatta’ <> ’REGATTA’ <> ‘regatta’ and ‘A’ < ‘B’ < ‘a’ < ‘b’).
  2. Values of type CHAR are converted to VARCHAR before the function or operator is applied, resulting in stripping any trailing spaces in the character value.
Notes:
  1. The string concatenation operator (||) accepts non-string input, so long as at least one input is of string type. Using the operator with NULL as one of the operator inputs, returns NULL. For example: SELECT 'Hello' || NULL || ' this is me'; Return: NULL
  2. CONCAT():
    • All values are implicitly converted to strings
    • NULL arguments are ignored. For example: SELECT CONCAT('Hello', NULL, ' this is me'); Return: ‘Hello this is me’
  3. LPAD() (RPAD()): If the string is already longer than the requested length_int then it is truncated on the right (left).
  4. LIKE and NOT LIKE: a . String match is case sensitive b . escape character should be a single character. c. Possible patterns:
    • An underscore (_): stands for a single character
    • A percent sign (%) stands for sequence of zero or more characters
    • If the pattern does not contain percent signs (%) or underscores (_), then the [NOT] LIKE operator matches the full string.