-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: CLOB problem in DB2
PostPosted: Wed Mar 14, 2007 2:54 pm 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
I am using TABLE per concrete class with the Hibernate Entity Manager for DB2.
One of the tables contains a CLOB. A select statement is off the form:

select person0_.clobAttr as clobAttr1 from ( select nullif(0,0) as clobAttr from TPerson union all select clobAttr from TMechanic union all select clobAttr from TEmployee union all select nullif(0,0) as clobAttr from TCustomer ) person0_ where LASTNAME='RelsTest'

Generates the DB2 exception:

DB2 SQL error: SQLCODE: -415, SQLSTATE: 42825, SQLERRMC: null

Any ideas what I am doing wrong?
Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 8:23 am 
Senior
Senior

Joined: Mon Jul 24, 2006 8:43 am
Posts: 160
Some update on this problem:
I m using DB2 version 8, I am using the dialect: org.hibernate.dialect.DB2Dialect.

It would appear that the syntax hibernate is generating is wrong. More specifically, DB2 does not like the syntax, nullif(0,0) as clobAttr, it should be cast(null as Clob) as clobAttr.

I am open to correction here, any ideas or comments appreciated.
cheers


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 11:30 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you open a JIRA issue with a minimal test case, that will help. (if possible do it with hbm.xml files)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.