-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to specify partition in HQL query ?
PostPosted: Thu Apr 26, 2007 1:17 am 
Newbie

Joined: Wed Jan 10, 2007 7:34 am
Posts: 3
Hi,

I have a partitioned table ORDERS having two partitions named: OpenOrders and ClosedOrders.

Now I want to fire a delete on some of the closed orders. So to make the query efficient i want to specify the partition from which to delete (which will be ClosedOrders partition).

But when I use normal SQL syntax :

delete from Orders partition (closedOrders) where id = ?

I get the exception "Unexpected Token partition "

Can anybody tell how to specify partition in HQL query?

_________________
Sandeep Chauhan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2007 4:48 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
Hi,
Here is a link pointing to HQL grammar.
http://anonhibernate.labs.jboss.com/tru ... mmar/hql.g

deleteStatement
: DELETE^
(optionalFromTokenFromClause)
(whereClause)?
;

optionalFromTokenFromClause!
: (FROM!)? f:path (a:asAlias)? {
AST #range = #([RANGE, "RANGE"], #f, #a);
#optionalFromTokenFromClause = #([FROM, "FROM"], #range);
}
;


I don't get it fully. Looks like, it is not possible to have partition specified here.

--------------------------------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.