| Using CLOBs in entities with Oracle [message #702933] |
Tue, 26 July 2011 20:39  |
Brendan Haverlock Messages: 46 Registered: July 2009 |
Member |
|
|
Hi all,
I am running into an issue with trying to use CLOBs in Oracle with EclipseLink. Basically, when I try to run a filter using the expression builder, I get the following error:
Error: ORA-00932: inconsistent datatypes: expected - got CLOB
I feel like I have tried everything. I have added the Oracle target database, I have upgraded my driver, updated EclipseLink, etc. and I am at my wits end. My column in my entity is annotated as follows:
@Lob
@Column(name = "description")
private String description;
Can someone please help me with this?
Thanks a bunch!
Brendan
|
|
|
|
| Re: Using CLOBs in entities with Oracle [message #703539 is a reply to message #703484] |
Wed, 27 July 2011 13:12   |
Brendan Haverlock Messages: 46 Registered: July 2009 |
Member |
|
|
This is the query that is being generated:
SELECT * FROM (SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM (SELECT t0.clob AS clob FROM code t0,
org t1 WHERE ((((((((UPPER(t0.x) = 'CJO0UUCO7G') AND (UPPER(t0.y) = 'FEODUQUUJH')) AND (t0.clob = '9BSMsjkuGA')) AND (UPPER(t0.a) = 'ZMP4ADKINK')) AND (UPPER(t0.b) = 'KOAFL4SNDN'))
AND (t0.c = 7)) AND (t1.d = 1021)) AND (t1.e = t0.e))) a WHERE ROWNUM <= 100) WHERE rnum > 0;
[Updated on: Wed, 27 July 2011 13:13] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: (no subject) [message #704546 is a reply to message #703564] |
Thu, 28 July 2011 15:22   |
Chris Delahunt Messages: 862 Registered: July 2009 |
Senior Member |
|
|
I do not believe Oracle allows using = on clobs. You will need to try something else, such as converting the clob in the database to a string, using EclipseLink's JPQL FUNC to use the database TO_CHAR function.
Something like
"select entity.clobField from Entity entity where (FUNC('TO_CHAR', entity.clobField) = '9BSMsjkuGA') and ... "
Best Regards,
Chris
[Updated on: Thu, 28 July 2011 15:24] Report message to a moderator
|
|
|
| (no subject) [message #704553 is a reply to message #703539] |
Thu, 28 July 2011 15:22  |
Chris Delahunt Messages: 862 Registered: July 2009 |
Senior Member |
|
|
I do not believe Oracle allows using = on clobs. You will need to try something else, such as converting the clob in the database to a string, using EclipseLink's JPQL FUNC to use the database TO_CHAR function.
Something like
"select entity.clobField from Entity entity where (FUNC(TO_CHAR, entity.clobField) = '9BSMsjkuGA') and ... "
Or use the LIKE operator instead of equals:
"select entity.clobField from Entity entity where (entity.clobField LIKE '9BSMsjkuGA') and ... "
Best Regards,
Chris
[Updated on: Thu, 28 July 2011 15:29] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.08365 seconds