oracle使用存储过程怎么读取blob数据啊,blob数据中存放的不是图片,是float类型的数据,或int型的,网上很多都是读取图片的,看的晕,求大侠解答

解决方案 »

  1.   


    不知道楼主什么版本的数据库 如果是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!
      

  2.   

    都是数字等字符的还是用clob好了.处理起来也方便些.