Character functions

Devart ODBC Driver for xBase supports the following character SQL functions.

Function Description
ALLTRIM(X) Removes all leading and trailing spaces from string X.
ASC(X) Returns the ASCII code of character X.
AT(X, Y, N) Returns the position of substring Y within string X, beginning the search from the N-th character. Returns -1 if the substring isn’t found. Case-sensitive.
CHR(X) Returns the character associated with ASCII code X.
CHRTRAN(X, A, B) Replaces each character in string X that matches a character in string A with the corresponding character from string B.
ISALPHA(X) Returns True if the first character in string X is a letter; otherwise, returns False.
ISDIGIT(X) Returns True if the first character in string X is a digit; otherwise, returns False.
ISLOWER(X) Returns True if all characters in string X are lowercase; otherwise, returns False.
ISUPPER(X) Returns True if all characters in string X are uppercase; otherwise, returns False.
LEFT(X, N) Returns the first N characters of string X.
LEN(X) Returns the number of characters in string X.
LOWER(X) Converts all characters in string X to lowercase.
LTRIM(X) Removes all leading spaces from string X.
PADC(X, N[, C]) Pads string X on both sides to a total length of N using character C. If C is omitted, spaces are used.
PADL(X, N[, C]) Pads string X on the left to a total length of N using character C. If C is omitted, spaces are used.
PADR(X, N[, C]) Pads string X on the right to a total length of N using character C. If C is omitted, spaces are used.
POS(X, Y[, N]) Alias for AT(X, Y, N).
PROPER(X) Capitalizes the first letter of every word in string X and converts the rest to lowercase.
REPLICATE(X, N) Returns a string composed of N copies of string X.
RIGHT(X, N) Returns the last N characters of string X.
SPACE(N) Returns a string consisting of N space characters.
STR(X[, N[, D[, C]]]) Returns the string representation of numeric value X. Optional N specifies the total length (default is 10), optional D specifies the number of decimal places (default is 0), and optional C specifies a left-side padding character to reach length N.
STRTRAN(X, A[, B]) Replaces all occurrences of substring A in string X with substring B. If B is omitted, all occurrences of A are deleted. Case-sensitive.
SUBSTR(X, P[, N]) Returns a substring from string X starting at position P. Optional N specifies the number of characters to extract (default is all remaining characters).
TRANSFORM(X) Converts value X to its string representation based on its data type.
TRIM(X) Removes all trailing spaces from string X.
UPPER(X) Converts all characters in string X to uppercase.
VAL(X) Returns the numeric representation of string value X.