Character Macro Functions (FireDAC)

From RAD Studio
Jump to: navigation, search

Go Up to Preprocessing Command Text (FireDAC)



The following table lists the character macro functions:

Function Description Local expression engine
ASCII(string_exp) Returns the ASCII code value of the leftmost character of string_exp as an integer. +
BIT_LENGTH(string_exp) Returns the length in bits of the string expression. -
CHAR(code) Returns the character that has the ASCII code value specified by code. The value of code should be between 0 and 255. Otherwise, the return value is data source–dependent. +
CHAR_LENGTH(string_exp) Returns the length in characters of the string expression, if the string expression is of a character data type. Otherwise, it returns the length in bytes of the string expression (the smallest integer, not smaller than the number of bits divided by 8). (This function is similar to the CHARACTER_LENGTH function.) +
CHARACTER_LENGTH(string_exp) Returns the length in characters of the string expression, if the string expression is of a character data type. Otherwise, it returns the length in bytes of the string expression (the smallest integer, not smaller than the number of bits divided by 8). (This function is similar to the CHAR_LENGTH function.) +
CONCAT(string_exp1, string_exp2) Returns a character string that is the result of concatenating string_exp2 to string_exp1. The resulting string is DBMS-dependent. For example, if the column represented by string_exp1 contained a NULL value, DB2 would return NULL, but SQL Server would return the non-NULL string. +
DIFFERENCE(string_exp1, string_exp2) Returns an integer value that indicates the difference between the values returned by the SOUNDEX function for string_exp1 and string_exp2. -
INSERT(string_exp1, start, length, string_exp2) Returns a character string where length characters have been deleted from string_exp1, beginning at start, and where string_exp2 has been inserted into string_exp, beginning at start. +
LCASE(string_exp) (ODBC 1.0) Returns a string equal to that in string_exp, with all uppercase characters converted to lowercase. +
LEFT(string_exp, count) Returns the leftmost count characters of string_exp. +
LENGTH(string_exp) Returns the number of characters in string_exp, excluding trailing blanks. +
LOCATE(string_exp1, string_exp2[, start]) Returns the starting position of the first occurrence of string_exp1 within string_exp2. The search for the first occurrence of string_exp1 begins with the first character position in string_exp2 unless the optional argument, start, is specified. If start is specified, the search begins with the character position indicated by the value of start. The first character position in string_exp2 is indicated by the value 1. If string_exp1 is not found within string_exp2, the value 0 is returned. +
LTRIM(string_exp) Returns the characters of string_exp, with leading blanks removed. +
OCTET_LENGTH(string_exp) Returns the length in bytes of the string expression. The result is the smallest integer, not smaller than the number of bits divided by 8. +
POSITION(character_exp, character_exp) Returns the position of the first character expression in the second character expression. The result is an exact numeric with an implementation-defined precision and a scale of 0. +
REPEAT(string_exp, count) Returns a character string composed of string_exp repeated count times. +
REPLACE(string_exp1, string_exp2, string_exp3) Search string_exp1 for occurrences of string_exp2, and replace with string_exp3. +
RIGHT(string_exp, count) Returns the rightmost count characters of string_exp. +
RTRIM(string_exp) Returns the characters of string_exp with trailing blanks removed. +
SOUNDEX(string_exp) Returns a data source–dependent character string representing the sound of the words in string_exp. For example, SQL Server returns a 4-digit SOUNDEX code, while Oracle returns a phonetic representation of each word. -
SPACE(count) Returns a character string consisting of count spaces. +
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. +
UCASE(string_exp) Returns a string equal to that in string_exp, with all lowercase characters converted to uppercase. +