Link to home
Start Free TrialLog in
Avatar of javaq092999
javaq092999

asked on

CLOB field in sql 'WHERE clause' gives ORA-00932: inconsistent datatypes

How to use CLOB fields in WHERE clause?
---------------------------------------

create table t (id number, data clob);

...properly inserted number of records having clob data...

select id from t where data like '%something%';

The above gives ORA-00932: inconsistent datatypes

How to use CLOB fields in WHERE clause?

I am using Oracle8.1.6 Windows 2000 JDK1.3 JDBC Thin/OCI8 drivers

--Many Thanks
ASKER CERTIFIED SOLUTION
Avatar of vanmeerendonk
vanmeerendonk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mozartny
mozartny

This should work:

select id
  from t
 where dbms_lob.instr(data,'something')>0;
Avatar of javaq092999

ASKER

Sorry  mozartny as I already solved the problem and I feel that clue provided by vanmeerendonk is what you have re-written more acurately. I forgot to close this question when I found the solution. I wish I could have given you both the points. Thanks you both specially "mozartny".
See my comments above. --javaq