-->
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: bulk update subselect doesnt work
PostPosted: Wed Nov 09, 2005 1:47 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 1:50 pm
Posts: 26
Hibernate version: 3

I want to do a bulk update which needs join. Because join doesnt work in bulk update , I am using subselect.

This is my query:

String query = "update PaymentCcards pcc set pcc.Number=null where pcc.Id in {select pcc.Id from PaymentCcards pcc, Booking b where pcc.BookingId=b.Id and b.FirstDate = :pfirstdate and pcc.Number is not null} ";

I get this error:
unexpected char: '{'


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 2:18 pm 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
That's because { is in invalid char. Use () not{}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 3:05 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 1:50 pm
Posts: 26
Thanks, But Still I have this error:

Column 'ID' in field list is ambiguous

Im not using ID any where in:

update PaymentCcards pc set pc.Number=null where pc.Number is not null and pc.Id in (select pcc.Id from PaymentCcards pcc, Booking b where b.FirstDate = :pfirstdate)


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.