![]() |
|
String FunctionsString functions perform various character manipulations, and they operate on character strings. ASCIIConverts a single character string to its corresponding ASCII code, between 0 and 255. Syntax: ASCII (character_expression) where:
If the character expression evaluates to more than one character, the ASCII code corresponding to the first character in the expression is returned. BIT_LENGTHReturns the length, in bits, of a specified string. Each Unicode character is 2 bytes in length, which is equal to 16 bits. Syntax: BIT_LENGTH (character_expression) where:
CHARConverts a numerical value between 0 and 255 to the character value corresponding to the ASCII code. Syntax: CHAR (n_expression) where:
CHAR_LENGTHReturns the length, in number of characters, of a specified string. Leading and trailing blanks are not counted in the length of the string. Syntax: CHAR_LENGTH (character_expression) where:
CONCATThere 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. Form 1 Syntax: CONCAT (character_expression1, character_expression2) where:
Form 2 Syntax: string_expression1 || string_expression2 || ... string_expressionxx where:
Example: Account."Account Name" ||'-'|| Account."Account Location" Results look like: Action Rentals - Headquarters INSERTInserts a specified character string into a specified location in another character string, replacing a specified number of characters in the target string. Syntax: INSERT (character_expression1, n, m, character_expression2) where:
LEFTReturns a specified number of characters from the left of a string. Syntax: LEFT (character_expression, n) where:
LENGTHReturns the length, in number of characters, of a specified string. The length is returned excluding any trailing blank characters. Syntax: LENGTH (character_expression) where:
LOCATEReturns the numerical position of one string within another string. If the string is not found, 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. Syntax: LOCATE (character_expression1, character_expression2) where:
LOCATENReturns the numerical position of one string within another string. This is identical to the LOCATE function, except that the search begins at the position specified by an integer argument. If the string is not found, 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. Syntax: LOCATEN (character_expression1, character_expression2, n) where:
LOWERConverts a character string to lower case. Syntax: LOWER (character_expression) where:
OCTET_LENGTHReturns the bits, in base 8 units (number of bytes), of a specified string. Syntax: OCTET_LENGTH (character_expression) where:
POSITIONReturns the numerical position of one string within another string. If the string is not found, the function returns 0. Syntax: POSITION (character_expression1 IN character_expression2) where:
REPEATRepeats a specified expression n times, where n is a positive integer. Syntax: REPEAT (character_expression, n) REPLACEReplaces specified characters in a string with other specified characters. Syntax: REPLACE (character_expression, change_expression, replace_with_expression) where:
RIGHTReturns a specified number of characters from the right of a string. Syntax: RIGHT (character_expression, n) where:
SPACEInserts blank spaces. Syntax: SPACE (integer) where:
SUBSTRINGCreates a new string starting from a fixed number of characters into the original string. Syntax: SUBSTRING (character_expression FROM starting_position) where:
Example: SUBSTRING ('ABCDEF' FROM 3) Results in: CDEF TRIMStrips specified leading and/or trailing characters from a character string. Syntax: TRIM (type 'character' FROM character_expression) where:
NOTE: The syntax TRIM (character_expression) is also valid. This trims all leading and trailing spaces. UPPERConverts a character string to uppercase. Syntax: UPPER (character_expression) where:
|
Published 7/6/2017 | Copyright © 2005, 2017, Oracle. All rights reserved. Legal Notices. |