Neoview SQL Reference Manual (R2.5)
TRANSLATE Function
The TRANSLATE function translates a character string from a source character set to a target
character set. The TRANSLATE function changes both the character string data type and the
character set encoding of the string.
TRANSLATE(character-value-expression USING translation-name)
character-value-expression
is a character string.
translation-name
is one of these translation names:
CommentsTarget Character SetSource Character SetTranslation Name
Translates ISO8859-1
characters to UCS2
characters. No data loss is
possible.
UCS2ISO88591ISO88591TOUCS2
Translates SJIS characters
in an ISO88591 column to
UCS2 characters
UCS2SJISSJISTOUCS2
Translates UTF8 characters
in an ISO88591 column to
UCS2 characters
UCS2UTF8UTF8TOUCS2
Translates UCS2 characters
to ISO8859-1 characters. No
data loss is possible.
Neoview SQL will display
error 8413 if it encounters
a Unicode character that
cannot be converted to the
target character set.
ISO88591UCS2UCS2TOISO88591
Translates UCS2 characters
in a UCS2 column to SJIS
characters
SJISUCS2UCS2TOSJIS
Translates UCS2 characters
to UTF8 characters
UTF8UCS2UCS2TOUTF8
translation-name identifies the translation, source and target character set. When you
translate to the UCS2 character set no data loss is possible. However, when Neoview SQL
translates a character-value-expression from UCS2, certain characters encoded in
UTF16 cannot be converted to the target character set. Neoview SQL displays an error in this
case.
Neoview SQL returns a variable-length character string with character repertoire equal to
the character repertoire of the target character set of the translation and the maximum length
equal to the fixed length or maximum variable length of the source
character-value-expression.
If you enter an illegal translation-name, Neoview SQL returns an error.
If the character set for character-value-expression is different from the source character
set as specified in the translation-name, Neoview SQL returns an error.
TRANSLATE Function 479