because it's BLOB , you can not use like that , 
select mlxh from zlmlnr WHERE dbms_lob.instr(nr,'中国',1,1)>0; is for CLOB column正确用法是:
select mlxh from zlmlnr 
WHERE dbms_lob.instr(nr,UTL_RAW.CAST_TO_RAW('中国'),1,1)>0

解决方案 »

  1.   

    刚才不是给了例子吗,可能与blob字段内容有关.
    SQL> select 1 from bb where dbms_lob.instr(d,'34',1,1)>1;         1
    ----------
             1
    返之这样会返会null值.
    SQL> select 1 from bb where dbms_lob.instr(d,utl_raw.cast_to_raw('34'),1,1)>1;         1
    ----------根据
    function insstr(lob_loc in blob,
                    pattern in raw,
                    offset  in integer:=1,
                    nth     in integer:=1)
    return integer;
      

  2.   

    '34' = cast_to_raw('4') '4'这个字符的RAW表达方式
    对BLOB的查询需要转换成RAW(二进制)表达方式
      

  3.   

    非常感谢楼上的两位,我先去公司试试,两位大哥,我直接调用dbms_lob.instr包就可以了吗?
    不需要在把函数也执行一遍吗?我是想先在SQLPLUS中试一下
      

  4.   

    我前台用的是JAVA,我已经通过JAVA将数据输入到了BLOB字段中,不知道是不是因为JAVA的问题,