不知道楼主什么版本的数据库 如果是10g或以上的可以用utl_raw.cast_to_varchar2()进行转换 --例如: create table t_blob(stuname varchar2(20),dblob blob); scott@YPCOST> ed 已写入 file afiedt.buf 1* insert into t_blob values ('tom',utl_raw.cast_to_raw('tom is a good boy!')) scott@YPCOST> /已创建 1 行。scott@YPCOST> select stuname,utl_raw.cast_to_varchar2(dblob) from t_blob;STUNAME -------------------- UTL_RAW.CAST_TO_VARCHAR2(DBLOB) ---------------------------------------------------------------------------------------------------- tom tom is a good boy! scott@YPCOST> update t_blob set dblob=utl_raw.cast_to_raw('tom is not a good boy!') where stuname='t om';已更新 1 行。scott@YPCOST> commit;提交完成。scott@YPCOST> select stuname,utl_raw.cast_to_varchar2(dblob) from t_blob;STUNAME -------------------- UTL_RAW.CAST_TO_VARCHAR2(DBLOB) ---------------------------------------------------------------------------------------------------- tom tom is not a good boy!
不知道楼主什么版本的数据库 如果是10g或以上的可以用utl_raw.cast_to_varchar2()进行转换
--例如:
create table t_blob(stuname varchar2(20),dblob blob);
scott@YPCOST> ed
已写入 file afiedt.buf 1* insert into t_blob values ('tom',utl_raw.cast_to_raw('tom is a good boy!'))
scott@YPCOST> /已创建 1 行。scott@YPCOST> select stuname,utl_raw.cast_to_varchar2(dblob) from t_blob;STUNAME
--------------------
UTL_RAW.CAST_TO_VARCHAR2(DBLOB)
----------------------------------------------------------------------------------------------------
tom
tom is a good boy!
scott@YPCOST> update t_blob set dblob=utl_raw.cast_to_raw('tom is not a good boy!') where stuname='t
om';已更新 1 行。scott@YPCOST> commit;提交完成。scott@YPCOST> select stuname,utl_raw.cast_to_varchar2(dblob) from t_blob;STUNAME
--------------------
UTL_RAW.CAST_TO_VARCHAR2(DBLOB)
----------------------------------------------------------------------------------------------------
tom
tom is not a good boy!