Bookshelf Home | Contents | Index | Search | PDF |
Siebel Analytics Server Administration Guide > SQL Reference > SQL Reference >
String Functions
String functions perform various character manipulations, and they operate on character strings.
ASCII
Converts a single character string to its corresponding ASCII code, between 0 and 255.
If the character expression evaluates to more than one character, the ASCII code corresponding to the first character in the expression is returned.
Bit_Length
Returns the length, in bits, of a specified string. Each Unicode character is 2 bytes in length, which is equal to 16 bits.
BIT_LENGTH (character_expression)
Char
Converts a numerical value between 0 and 255 to the character value corresponding to the ASCII code.
Char_Length
Returns the length, in number of characters, of a specified string. Leading and trailing blanks are not counted in the length of the string.
CHAR_LENGTH (character_expression)
Concat
There are two forms of this function. The first form concatenates two character strings. The second form uses the character string concatenation character to concatenate more than two character strings.
CONCAT (character_expression1, character_expression2)
CONCAT (string_expression1 || string_expression2 || ... string_expressionxx)
Insert
Inserts a specified character string into a specified location in another character string.
INSERT(character_expression, n, m, character_expression)
Left
Returns a specified number of characters from the left of a string.
Length
Returns the length, in number of characters, of a specified string. The length is returned excluding any trailing blank characters.
Locate
Returns the numerical position of the character_expression1 in a character expression. If the character_expression1 is not found in the character expression, the Locate function returns a value of 0. If you want to specify a starting position to begin the search, use the LocateN function instead.
LOCATE(character_expression1, character_expression2)
LocateN
Returns the numerical position of the character_expression1 in a character expression. This is identical to the Locate function, except that the search for the pattern begins at the position specified by an integer argument. If the character_expression1 is not found in the character expression, the LocateN function returns a value of 0. The numerical position to return is determined by counting the first character in the string as occupying position 1, regardless of the value of the integer argument.
LOCATE(character_expression1, character_expression2, n)
Lower
Converts a character string to lower case.
Octet_Length
Returns the bits, in base 8 units (number of bytes), of a specified string.
OCTET_LENGTH (character_expression)
Position
Returns the numerical position of the character_expression1 in a character expression. If the character_expression1 is not found, the function returns 0.
POSITION(character_expression1 IN character_expression2)
Repeat
Repeats a specified expression n times, where n is a positive integer.
REPEAT(character_expression, n)
Replace
Replaces specified characters from a specified character expression with other specified characters.
REPLACE(character_expression, change_expression, replace_with_expression)
Right
Returns a specified number of characters from the right of a string.
RIGHT(character_expression, n)
Substring
Creates a new string starting from a fixed number of characters into the original string.
SUBSTRING (character_expression FROM starting_position)
TrimBoth
Strips specified leading and trailing characters from a character string.
TRIM (BOTH 'character' FROM character_expression)
TrimLeading
Strips specified leading characters from a character string.
TRIM (LEADING 'character' FROM character_expression)
TrimTrailing
Strips specified trailing characters from a character string.
TRIM (TRAILING 'character' FROM character_expression)
Upper
Converts a character string to uppercase.
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Analytics Server Administration Guide Published: 11 March 2004 |