String Functions

<< Click to Display Table of Contents >>

Navigation:  SQL Reference > Functions and Operators >

String Functions

Previous pageReturn to chapter overviewNext page

 

Absolute Database supports the following string functions:

Function

Description

LOWER

Converts string to lower case

UPPER

Converts string to upper case

SUBSTRING

Extracts substring

POS

Location of specified substring

LENGTH

Number of characters in string

LTRIM

Returns the string with leading space characters removed

RTRIM

Returns the string with trailing space characters removed

TRIM

Returns the string with leading and trailing space characters removed

 

LOWER (string_exp)

Returns a string equal to that in string_exp with all uppercase characters converted to lowercase.

Example:

LOWER('TOM') returns tom

 

UPPER (string_exp)

Returns a string equal to that in string_exp with all lowercase characters converted to uppercase.

Example:

UPPER('tom') returns TOM

 

SUBSTRING (string_exp, start [, length])

Returns a character string that is derived from string_exp beginning at the character position specified by start for length characters.

Example:

SUBSTRING("ABCDE", 4, 2) returns DE

 

POS (substring_exp, string_exp)

Returns the position of the first character expression in the second character expression.

Example:

POSITION('CDE','ABCDEFG') returns 3  

 

LENGTH (string_exp)

Returns the number of characters in string_exp.

Example:

LENGTH('ABCEDFG') returns 7

 

LTRIM (string_exp)

Returns the characters of string_exp, with leading blanks removed.

Example:

LTRIM(' Tom') returns Tom

 

RTRIM (string_exp)

Returns the characters of string_exp, with trailing blanks removed.

Example:

RTRIM('Tom ') returns Tom

 

TRIM (string_exp)

Returns the characters of string_exp with leading and trailing space characters removed.

Example:

TRIM(' Tom ') returns Tom

__________________________
Absolute SQL Reference - 05 January 2023, Niels Knabe