-->
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: insert into ... select
PostPosted: Wed Dec 22, 2004 9:28 am 
Newbie

Joined: Wed Dec 15, 2004 9:14 am
Posts: 4
How do I execute an "insert into [tablename] values ([fieldname1], [fieldname2], ...) select [field1], [field2], ... from [anotherTableName]" ?

1 ) HQL documentation chapter 11 only explains "select" syntax.
2 ) session.createSQLQuery "Can not issue data manipulation statements with executeQuery()"
3 ) I don't want to instantiate many objects and save them. For performance reasons, I prefer one massive SQL request. But I still want to use HIbernate even for this request because database access is configured through it and I use it in other parts of my application.

Any idea on this would be greatly appreciated.

Loïc


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 9:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use session.connection() and do a JDBC query.


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.