Using CLOBs in entities with Oracle [message #702933] |
Tue, 26 July 2011 20:39  |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
(no subject) [message #704553 is a reply to message #703539] |
Thu, 28 July 2011 15:22  |
Eclipse User |
|
|
|
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] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.24886 seconds