-->
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 could I limit the row count in delete query?
PostPosted: Mon Nov 23, 2009 1:32 am 
Newbie

Joined: Mon Nov 23, 2009 1:28 am
Posts: 1
for MySQL
I need it to be "delete from tableA limit 10"

for Oracle
I need it to be "delete from tableA ROWNUM<10"

I am using JPA implementation.
I tried em.createQuery("delete from A").setMaxResult(10).executeUpdate();
no luck, any idea?

Thank you


Top
 Profile  
 
 Post subject: Re: how could I limit the row count in delete query?
PostPosted: Mon Nov 23, 2009 5:17 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
I think you have to use native sql.

_________________
-----------------
Need advanced help? http://www.viada.eu


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.