如何用SQL操作oracle的blob字段里的字符串数据

如题所述

可以通过dbms_lob来辅助查询:
--创建测试表
create table tt1 (XXName varchar2(20),ProductIDs blob);
--向测试表中插入数据
insert into tt1 select 'a',to_blob('a001b002') from dual;
--查询blob字段中含有'a001'的记录select XXName from tt1 where mod(dbms_lob.instr(ProductIDs,'a001'),2)=1
--删除测试表
drop table tt1;
温馨提示:答案为网友推荐,仅供参考
相似回答