Character functions are used to manipulate values returned on character fields.
The following table provides a list of the character functions that you can use in queries. The Oracle Function column contains the function you will need to use if you are using an Oracle schema. The SQL Server Function column contains the function you will need to use if you are using a SQL Server database. Selecting a link in the table will open the appropriate example drop-down within this topic.
In some cases, there is no SQL Server equivalent of an Oracle function. In these cases, the SQL Server Function column contains an empty, shaded cell.
Description | Oracle Function | SQL Server Function |
---|---|---|
Convert character to ASCII | ASCII | ASCII |
Convert ASCII to character | CHR | CHAR |
Convert string if null | NVL | ISNULL |
Translate character string | TRANSLATE | None |
Combintion of letters and numbers that use the Soundex Indexing System to represent the character string (See note) | SOUNDEX | SOUNDEX |
Convert characters to uppercase | UPPER | UPPER |
Convert characters to lowercase | LOWER | LOWER |
Capitalize first letter of each word in string | INITCAP | None |
Greatest character string in list | GREATEST | None |
Least character string in list | LEAST | None |
String concatenate | CONCAT | (expression + expression) |
Substring | SUBSTR | SUBSTRING |
Return starting point of character in character string (from left) | INSTR | CHARINDEX |
Length of character string in list | LENGTH | LEN or DATALENGTH |
Pad left side of character string | LPAD | None |
Remove leading blanks | LTRIM | LTRIM |
Remove trailing blanks | RTRIM | RTRIM |
Replace characters | REPLACE | STUFF |
String of repeated spaces | RPAD | SPACE |
Copyright © 2018 General Electric Company. All rights reserved.