Ska*_*kay 18 oracle search blob
是否可以使用sql语句搜索blob文本?我可以从$ table中选择*,其中f1如'%foo%',如果f1是varchar,那么f1是一个blob怎么样?对此有何反击?
Ola*_*son 62
这很容易做到.
只需将dbms_lob.instr与utl_raw.cast_to_raw结合使用即可
因此,在您的情况下,如果t1是BLOB,则select将如下所示:
select *
  from table1
 where dbms_lob.instr (t1, -- the blob
                   utl_raw.cast_to_raw ('foo'), -- the search string cast to raw
                   1, -- where to start. i.e. offset
                   1 -- Which occurrance i.e. 1=first
                    ) > 0 -- location of occurrence. Here I don't care.  Just find any
;
| 归档时间: | 
 | 
| 查看次数: | 51947 次 | 
| 最近记录: |