开发者

Conditions (like "like") on binary field (blob) in oracle

开发者 https://www.devze.com 2023-02-01 21:10 出处:网络
How can I search in (put condition on) blob field in oracle, like text fields? I need someting like: select * from table_name where blob_field like \'%00ff00ff%\'

How can I search in (put condition on) blob field in oracle, like text fields?

I need someting like:

select * from table_name where blob_field like '%00ff00ff%'

Oracle throws some er开发者_如何学运维ror on it.


You can use dbms_lob.instr for this purpose i.e.

   select * from table_name 
   where dbms_lob.instr(blob_field, utl_raw.CAST_TO_RAW('00ff00ff'), 1, 1) > 0


select *
from NDF_MODEL_PARAM
where dbms_lob.instr(VALUE, 'NaN') > 0;
0

精彩评论

暂无评论...
验证码 换一张
取 消