|
j_kathiresan
Starting Member
1 Posts |
Posted - 07/11/2011 : 06:19:28
|
Hi All,
I've declared a Hibernate column as type "text" which creates the column as "longtext" in MySQL, "nvarchar" in SQL Server and "CLOB" in Oracle.
I need to write a SQL query which works for all databases.
Ex: to_char() it doesn't works in MySQL but works fine in Oracle.
Please guide with a generic query which supports all the databases.
Thanks, Kathir.
|
|
|
robvolk
Most Valuable Yak
USA
15557 Posts |
Posted - 07/11/2011 : 07:43:12
|
Look at the CAST() function, I believe that is ANSI standard and should work in all of the products you mentioned. Since each data type you mentioned is used for character data it should implicitly convert to a string in Hibernate.
If not you'll have better luck posting in a forum dedicated to Hibernate, SQLTeam is a Microsoft SQL Server site only. |
 |
|