-->
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: HQL question - creating temporary tables in FROM clause
PostPosted: Fri Jan 28, 2005 9:09 pm 
Newbie

Joined: Wed Sep 17, 2003 9:02 pm
Posts: 13
Hello.

I have a basic question. Can I use HQL to create a temporary table in the FROM clause of a select statement and then join the temporary table with another table in the same select clause.

My native SQL (Oracle 8i) is as follows:

select a.* from address_validation a,
(select min(av_seqno) seqno, av_zipcode, av_state, av_city from address_validation where av_zipcode = 97230 group by av_zipcode, av_state, av_city) b
where a.av_zipcode = b.av_zipcode
and a.av_state = b.av_state
and a.av_city = b.av_city
and a.av_seqno = b.seqno.

I would like to convert this to an HQL. But, when I convert it, I get an Query exception with the message "in expected".

Can anyone help me to solve this problem.

Thanks a lot in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 28, 2005 10:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Sorry not supported. Maybe in the future for Hibernate 3 though portablity could be an issue.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 3:47 am 
Regular
Regular

Joined: Tue Jun 03, 2008 1:12 pm
Posts: 84
Location: germany
Are temporary tables now supported???


How can I use temporary tables in HQL?


Something like (SQL):

Code:
with temp (a,b,c) as (select a,b,c from entityA), temp2(c,d,f) as (select c*a,d,f*c from entityB) 



So you see, I need a temporary table that values are available in another table in the same Query.

Any suggestions?


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.