Solved

Oracle search clob field

Posted on 2015-02-09
4
389 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
  • 2
  • 2
4 Comments
 
LVL 76

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 76

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now