Solved

Oracle search clob field

Posted on 2015-02-09
4
405 Views
Last Modified: 2015-02-09
Experts,

I am trying to search text in a couple clob fields.  I saw where you can use dbms_lob.substr but not sure. Here is my query

	SELECT *
		FROM EMAIL_REPORTING ER
		WHERE  ER.MESSAGE_TYPE = 0 -- 'Inbound' 
	            AND NOT(
                    ER.TEXT_BODY in ('Ticket Notification%')
                     OR ER.SUBJECT in ('Your conference ended')
                     OR ER.SUBJECT like ('Undeliverable%')
                     )

Open in new window



 ORA-00932: inconsistent datatypes: expected - got CLOB
0
Comment
Question by:Maliki Hassani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40598939
Not sure what you are doing with your 'IN' clauses there.

Why not just use a LIKE?

It will be slow but it should work.

If you have a LOT of data and the CLOB's are large, I might look at Oracle Text and use a CONTAINS query.

If you can provide more information, we can provide better possibilities.
0
 

Author Comment

by:Maliki Hassani
ID: 40598951
Correction it should have been a like statement.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40598954
What is your specific version or Oracle (all 4 numbers please)?
Which columns are CLOBs?
0
 

Author Comment

by:Maliki Hassani
ID: 40598957
So it seems that I fixed the error by using the like.  Since this is a one time run there isn't a further need for a fix.

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question