数据仓库服务 GAUSSDB(DWS)-类型转换函数:to_clob(char/nchar/varchar/nvarchar/varchar2/nvarchar2/text/raw)

时间:2024-01-26 16:15:24

to_clob(char/nchar/varchar/nvarchar/varchar2/nvarchar2/text/raw)

描述:将RAW类型或者文本字符集类型CHAR、NCHAR、VARCHAR、VARCHAR2、NVARCHAR2、TEXT转成CLOB类型。

返回值类型:clob

示例:

1
2
3
4
5
SELECT to_clob('ABCDEF'::RAW(10));
 to_clob 
---------
 ABCDEF
(1 row)
1
2
3
4
5
SELECT to_clob('hello111'::CHAR(15));
 to_clob  
----------
 hello111
(1 row)
1
2
3
4
5
SELECT to_clob('gauss123'::NCHAR(10));
 to_clob  
----------
 gauss123
(1 row)
1
2
3
4
5
SELECT to_clob('gauss234'::VARCHAR(10));
 to_clob  
----------
 gauss234
(1 row)
1
2
3
4
5
SELECT to_clob('gauss345'::VARCHAR2(10));
 to_clob  
----------
 gauss345
(1 row)
1
2
3
4
5
SELECT to_clob('gauss456'::NVARCHAR2(10));
 to_clob  
----------
 gauss456
(1 row)
1
2
3
4
5
SELECT to_clob('World222!'::TEXT);
  to_clob  
-----------
 World222!
(1 row)
support.huaweicloud.com/sqlreference-820-dws/dws_06_0036.html