,ch04.13730 Page 169 Wednesday, November 29, 2000 4:43
,ch04.13730 Page 171 Wednesday, November 29, 2000 4:43 PM CONVERT and TRANSLATE The CONVERT function alters the representation of a character string within its character set and collation. For example, CONVERT might be used to alter the number of bits per character. TRANSLATE alters the character set of a string value from one base-character set to another. Thus, TRANSLATE might be used to translate a value from the English character set to a Kanji (Japanese) or Russian character set. The translation must already exist, either by default or having been created using the CREATE TRANSLATION command. SQL99 Syntax CONVERT (char_value target_char_set USING form_of_use source_char_name) TRANSLATE(char_value target_char_set USING translation_name) Among the database vendors, only Oracle supports CONVERT and TRANSLATE with the same meaning as SQL99. Oracle s implementation of TRANSLATE is very similar to SQL99, but not identical. In its implementation, Oracle accepts only two arguments and allows translating only between the database character set or the national language support character set. MySQL s implementation of the CONVERT function only translates numbers from one base to another. In contrast, Microsoft SQL Server s implementation of CONVERT is a very rich utility that alters the base datatype of an expression, but is otherwise dissimilar to the SQL99 CONVERT function. PostgreSQL does not support CONVERT, and its implementation of TRANSLATE serves to morph any occurrence of a character string to any other character string. MySQL Syntax and Variations CONV(int, from_base, to_base) MySQL does not support TRANSLATE. This implementation of CONVERT returns a string value representing the number as it is converted from the from_base value to the to_base value. If any of the numbers are NULL, then the function returns NULL. Following are some examples: SELECT CONV(”a”,16,2); -> ‘1010′ SELECT CONV(”6E”,18,8); -> ‘172′ SELECT CONV(-17,10,-18); -> ‘-H’ Microsoft SQL Server Syntax and Variations CONVERT (data_type[(length) | (precision,scale)], expression[,style]) Microsoft SQL Server does not support TRANSLATE. Microsoft s implementation of the CONVERT function does not follow the SQL99 specification. Instead, it is functionally equivalent to the CAST function. The style clause is used to define the Functions CONVERT and TRANSLATE 171
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
doxycycline hyclate uses…
news…
Trackback by doxycycline hyclate uses — November 21, 2007 @ 9:23 pm