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: Using LIKE with a LONG field

Re: Using LIKE with a LONG field

From: Michael Kuznetsov <mvk_at_servocomp.ru>
Date: 23 Aug 2002 07:23:49 -0700
Message-ID: <1543a3e7.0208230623.ed68643@posting.google.com>


Hi Kevin,

You can't use like with LONG field. But if you can use LOB type instead of LONG you can use DBMS_LOB package. It has some procedures to compare LOBs.

For example:

You can create sql statement which works like 'LIKE':

create table tmp_lob (
  id number not null,
  big_text clob
);

insert into tmp_lob values (1, 'Long long text');

select id
from tmp_lob
where dbms_lob.instr(big_text, 'long') > 0;

Regards,
Michael
Brainbench MVP for Oracle Programming
http://www.brainbench.com

kevin_at_questionmark.com (Kevin Blount) wrote in message news:<1511a6a5.0208201240.9819194_at_posting.google.com>...
> I'm trying to search through a LONG field which contains the
> description of an item in my database. However, when I use the
> following SQL Query I am told that I have 'inconsistant datatypes'
> when I run the Query (in ASP)
>
> SELECT * FROM resources_objects WHERE resource_object_description
> LIKE '%string%'
>
> Any idea how I can use LIKE with a LONG field? I'm pretty certain it's
> this LONG field type that's caussing the issue, as the same SQL Query
> with a different field type (VARCHAR2) works fine.
Received on Fri Aug 23 2002 - 09:23:49 CDT

Original text of this message

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