-->
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.  [ 1 post ] 
Author Message
 Post subject: Generic SQL subselect statement for clob (select, group by)
PostPosted: Tue Jul 12, 2011 4:00 am 
Newbie

Joined: Tue Jul 12, 2011 3:44 am
Posts: 2
Hi All,

I've declared a Hibernate column as type "text" and internally we created the column as "longtext" in MySQL, "nvarchar" in SQL Server and "CLOB" in Oracle.

I've defined a view in subselect in hbm file and it works fine for mysql but it failed in other databases since i've selected the above clob field and used in group by clause too.

I need to write a generic SQL view query and puts in <subselect> element which works for all databases, atleast for the three databases.

Ex: to_char() it doesn't works in MySQL but works fine in SQL Server and Oracle.
cast() and varchar works fine in SQL Server and Oracle but MySQL doesn't support varchar in cast() or
convert() method.

Please guide with a generic query which supports all the databases, atleast the above three databases.

Also, is it possible to define DB specific subselect in hibernate hbm file?

Can you please let me know your thoughts in detail?

Thanks,
Kathir.


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

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.