Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: CLOB in select?

Re: CLOB in select?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 19 Sep 2001 08:01:08 -0700
Message-ID: <9oabvk01bl8@drn.newsguy.com>


In article <9oa766$r0s$00$1_at_news.t-online.com>, "Michael says...
>
>Hi,
>
>i am having a table, where long text is stored in a CLOB-field. When i am
>sending the query like:
>
>select * from Scott.TEST WHERE xml_doc LIKE 'test' ;
>
>i am getting the error ORA-00932.
>The oracle-reference is describing, that LONG-datatypes cannot be used in
>the where-clause. Is it the same with CLOB-datatype?
>
>Thanks in advance, Michael
>
>
>
>

In 8i and before, you cannot do that. You would have to

select * from scott.test where dbms_lob.instr( xml_doc, 'test' ) > 0;

In 9i, you can use LIKE on a clob.

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Wed Sep 19 2001 - 10:01:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US