convert函数 (oracle和sqlserver)
来源:互联网 发布:isv软件 编辑:程序博客网 时间:2024/06/05 03:02
1.在oracle中,一般是把一个字符串从一种编码类型转换成另一种编码类型
http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/functions023.htm#sthref1160
CONVERT
Syntax
convert::=
CONVERT(char, dest_char_set[, source_char_set ])Purpose
CONVERT
converts a character string from one character set to another. The datatype of the returned value is VARCHAR2
.
-
The
char
argument is the value to be converted. It can be any of the datatypesCHAR
,VARCHAR2
,NCHAR
,NVARCHAR2
,CLOB
, orNCLOB
. -
The
dest_char_set
argument is the name of the character set to whichchar
is converted. -
The
source_char_set
argument is the name of the character set in whichchar
is stored in the database. The default value is the database character set.
Both the destination and source character set arguments can be either literals or columns containing the name of the character set.
For complete correspondence in character conversion, it is essential that the destination character set contains a representation of all the characters defined in the source character set. Where a character does not exist in the destination character set, a replacement character appears. Replacement characters can be defined as part of a character set definition.
Examples
The following example illustrates character set conversion by converting a Latin-1 string to ASCII. The result is the same as importing the same string from a WE8ISO8859P1 database to a US7ASCII database.
SELECT CONVERT('Ä Ê Í Ó Ø A B C D E ', 'US7ASCII', 'WE8ISO8859P1') FROM DUAL; CONVERT('ÄÊÍÓØABCDE' --------------------- A E I ? ? A B C D E ?
Common character sets include:
-
US7ASCII: US 7-bit ASCII character set
-
WE8DEC: West European 8-bit character set
-
F7DEC: DEC French 7-bit character set
-
WE8EBCDIC500: IBM West European EBCDIC Code Page 500
-
WE8ISO8859P1: ISO 8859-1 West European 8-bit character set
-
UTF8: Unicode 3.0 UTF-8 Universal character set, CESU-8 compliant
-
AL32UTF8: Unicode 3.1 UTF-8 Universal character set
----------------------------------------------------------------------------------------
2.SQLSERVER
http://gjbxx110.blog.51cto.com/794841/297007
- convert函数 (oracle和sqlserver)
- sqlserver CAST 和 CONVERT函数
- sqlserver CAST 和 CONVERT函数
- 【转】sqlserver CAST 和 CONVERT函数
- SqlServer日期(convert函数,getdate函数)
- SqlServer Convert 函数应用
- SQLSERVER convert函数
- SqlServer之Convert 函数
- SqlServer convert函数使用
- 使用sqlserver convert()函数
- sqlserver四舍五入使用round函数及cast和convert函数
- SQLServer的CONVERT函数介绍
- SQLServer CONVERT函数的用法.
- sqlserver CONVERT()函数用法小结
- sqlServer convert函数style代码
- SqlServer Convert函数 日期格式化
- sql 转换成yyyy-mm-dd格式和SqlServer中得到当前日期(convert函数,getdate函数)
- 【Sqlserver系列】CAST和CONVERT
- 用js导出数据到Excel文档
- 我来了,这个世界
- linux开发者的一天
- sprintf的用法
- C中的return语句
- convert函数 (oracle和sqlserver)
- 一切新闻皆旧闻VS互联网信息时代
- Internal Server Error
- 菜鸟学习存储过程
- oracle 10g 数据如何导入到oracle 9i时BUG解决方法
- android小程序--猜猜红桃A在哪儿
- fd_set 用法 socket
- UCHome数据调用sql语句集合
- 快捷方式大全