-->
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: SQL Cast function problem with HQL
PostPosted: Thu Jun 09, 2005 11:18 am 
Newbie

Joined: Wed Dec 22, 2004 4:25 pm
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.05 (latest release)
Name and version of the database you are using: Ms Sql Server 2000
dialect:<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
The generated SQL (show_sql=true):None Available


I am trying to run the following HQL but am getting an error about the cast function:

select new com.pvr.util.CacheBean(lv.id,lv.ItemKey,lv.ItemDescription) from LookupValues lv
where lv.GroupName = ''NUMBERS'' and
cast(lv.ItemKey AS Integer) < 4
order by cast(lv.ItemKey AS Integer)

The error is not very descriptive:
ERROR [2005-06-09 10:00:49,594] *** ERROR: line 2:17: unexpected token: AS

I run a number of queries like this and they all work .. though none of the others are using the cast function.

I am guessing I have the wrong syntax in there but I cannot find
any info about the cast function in Hibernate.

Anyone have an idea?

Thanks.....


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.