|Lesson 6||Character Set Conversion|
|Objective||Understand how Oracle converts between character sets.|
CONVERTfunction. The syntax for the function is
CONVERT(char, dest_char_set, [src_char_set])
TRANSLATE USINGfunction to translate values into either the database character set or the national character set for the database. The syntax for the function is
TRANSLATE text USING CHAR_CS/NCHAR_CS
CHAR_CSindicates that you want to convert the string to the database character set, with an output type of
NCHAR_CSindicates that you want to convert the string to the national character set, with an output type of
TO_CHAR, TO_DATE, and
TO_NUMBERfunctions can have an optional parameter specified to indicate that the source is in a particular national character set.
NLS_UPPER, NLS_LOWER, and
NLS_INITCAPfunctions take into account the fact that certain national character sets have different rules for uppercase, lowercase, and initial capitalization. These functions take these differences into account when you specify an
NLS_SORTis used when you want to compare values based on their order in the specified national language set. Normally, comparisons in a
WHEREclause are made with binary values. If your national language was German and you wanted to compare two values based on their German sort order, you would use the syntax WHERE NLS_SORT(value1) > NLS_SORT(value2).