-->
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.  [ 1 post ] 
Author Message
 Post subject: "Number of select types did not match those for insert"
PostPosted: Tue Nov 09, 2010 10:52 am 
Newbie

Joined: Tue Nov 09, 2010 10:40 am
Posts: 1
Hi guys,

im having some troubles when i try to make an insert with hql.
This is an example of what im trying to do

String hqlQuery = "insert into A (name,state) select name,:stateP from B";
Query query = session.createQuery(hqlQuery).setInteger("stateP",1);

That piece of code throws me the following exception

"Number of select types did not match those for insert"

In Entity A, state property is Integer.

I think the problem is in select statement. How can i add parameters in select clause in order to insert them with hql insert query ?

Im using Hibernate3

Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.