String Functions

Advantage SQL Engine

collation_lang = Either ads_default_cs (case sensitive) or ads_default_ci (case insensitive)

 

ASCII( str )

Returns integer ASCII value for single character at start of str.

BIT_LENGTH( str )

Returns length of str in bits (assumes 8-bit characters).

CHAR( int )

Returns a character value from ASCII integer.

CHAR_LENGTH( str )

Returns the length of string in characters.

CHARACTER_LENGTH( str )

Returns the length of string in characters.

COLLATE collation_lang

Coerces the preceding value to the specified collation language. Note: COLLATE is a clause, not a scalar function. It can be used after column references, string literals, scalar functions, and expressions. See Comparison Operators and Coercion.

CONCAT( str1, str2 )

Returns a string that is the result of concatenating str2 to str1.

INSERT( str1, start, length, str2 )

Returns a character string where length characters have been deleted from str1, beginning at start, and where str2 has been inserted into str1, beginning at start.

LCASE( str )

Returns string with all uppercase characters converted to lowercase.

LEFT( str, count )

Return the left part of string str up to count characters.

LENGTH( str )

Returns the number of characters in str, excluding trailing blanks.

LOCATE( str1, str2[, start] )

Return integer location (1-based) of str1 in str2, with optional start starting point.

If str1 is not found in str2, 0 is returned.

LOWER( str )

Returns a string with all uppercase characters converted to lowercase.

LTRIM( str )

Returns string with leading spaces from <removed> left side of string.

OCTET_LENGTH( str )

Returns length of string in octets (i.e., bytes).

POSITION( str1 IN str2 )

Returns the position of str1 in str2.

REPEAT( str, cnt )

Returns a string consisting of str repeated up to cnt times.

REPLACE( str1, str2, str3 )

Replace all occurrences of str2 in str1 with str3.

RIGHT( str, count )

Returns a string of count characters of right part of str.

RTRIM( str )

Returns a string with trailing spaces removed from the right side of string.

SPACE( count )

Returns a string of space repeated up to count times.

SUBSTRING( str, pos, len )

Returns a portion of str starting at pos, up to length len.

TRIM( [[ LEADING | TRAILING | BOTH [ str1 ] FROM ] | [ str1 FROM ]] str2 )

Returns a string that has trimmed leading or trailing (or both) occurrences of str1 from str2. Returns NULL if either str1 or str2 is NULL. See TRIM for more information.

UCASE( str )

Returns a string with all lowercase characters converted to uppercase.

UPPER (str)

Returns a string with all lowercase characters converted to uppercase.