问题
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 error on it.
回答1:
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
来源:https://stackoverflow.com/questions/4577986/conditions-like-like-on-binary-field-blob-in-oracle