Solved

Oracle search clob field

Posted on 2015-02-09
4
403 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 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

696 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