-->
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: Insert wz Select
PostPosted: Wed Jun 07, 2006 9:31 am 
Newbie

Joined: Wed Jun 07, 2006 9:29 am
Posts: 1
Just a newbie question I couldn't find...

How can I do something as "INSERT INTO table (fields...) SELECT (fields) FROM table2"?

Thanks.


Top
 Profile  
 
 Post subject: Re: Insert wz Select
PostPosted: Wed Jun 07, 2006 7:07 pm 
Beginner
Beginner

Joined: Sat Jun 03, 2006 6:23 pm
Posts: 28
__celso wrote:
Just a newbie question I couldn't find...

How can I do something as "INSERT INTO table (fields...) SELECT (fields) FROM table2"?

Thanks.


Check the documentation at 13.4. DML-style operations.

Code:
String hqlInsert = "insert into DelinquentAccount (id, name) select c.id, c.name from Customer c where ...";
int createdEntities = s.createQuery( hqlInsert ).executeUpdate();


Roland


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 13, 2006 9:21 am 
Newbie

Joined: Tue Jun 13, 2006 9:16 am
Posts: 1
szroland you imbecile!!!! have you ever make insert on HQL??????
anyone could read the documentation!


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.