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: Using Functions in HQL
PostPosted: Wed Oct 17, 2007 8:46 pm 
Newbie

Joined: Wed Oct 17, 2007 8:41 pm
Posts: 2
Hi,

I can register and use SQL functions in HQL, but it only works on the WHERE clause.
Why can't I use in the projection clause like this?

"SELECT dbo.MyFunction(t.Field) FROM Table t"

I don't understand this technical limitation.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 25, 2007 4:30 pm 
Newbie

Joined: Wed Oct 17, 2007 8:41 pm
Posts: 2
Anyone please?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 2:43 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
Check this post out:
[url]
http://www.ayende.com/Blog/archive/2006/10/01/7235.aspx
[/url]

I'd guess the problem you are having is because you are passing a parameter from the FROM alias.
I'd test it with a static parameter :parameter and see if it works then adjust accordingly.

_________________
If this helped...please remember to rate it!


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.